ucwords
laravel/framework
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Uppercase the first character of each word in a string
ucwords
(
string $string
,
string $separators
=
" \t\r\n\f\v"
):
string
}
if (!
ctype_lower
(
$value
)) {
$value
=
preg_replace
(
'/\s+/u'
,
''
,
ucwords
(
$value
));
$value
= static::
lower
(
preg_replace
(
'/(.)(?=[A-Z])/u'
,
'$1'
.
$delimiter
,
$value
));
}
src/Illuminate/Support/Str.php