preg_replace

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Perform a regular expression search and replace
<?php preg_replace(    string|array $pattern,    string|array $replacement,    string|array $subject,    int $limit = -1,    int &$count = null): string|array|null
<?php         $input = str_replace(['_', '-'], ' ', $input);




        $input = (string) preg_replace('/([a-z])([A-Z])/', '$1 $2', $input);




        $input = (string) preg_replace('/([A-Z]+)([A-Z][a-z])/', '$1 $2', $input);
<?php         $input = (string) preg_replace('/([a-z])([A-Z])/', '$1 $2', $input);




        $input = (string) preg_replace('/([A-Z]+)([A-Z][a-z])/', '$1 $2', $input);




        $input = (string) preg_replace('/\s+/', ' ', $input);
<?php         $input = (string) preg_replace('/([A-Z]+)([A-Z][a-z])/', '$1 $2', $input);




        $input = (string) preg_replace('/\s+/', ' ', $input);




        return strtolower($input);