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
public function __get($property)
{
$studlyProperty = str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $property)));
if (method_exists($this, $computedMethodName = 'get'.$studlyProperty.'Property')) {
if (isset($this->computedPropertyCache[$property])) {
{
$studlyProperty = str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $property)));
if (method_exists($this, $computedMethodName = 'get'.$studlyProperty.'Property')) {
if (isset($this->computedPropertyCache[$property])) {
$studlyProperty = str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $property)));
$method = 'hydrate'.$studlyProperty;
$instance->{$method}($value, $request);
}
$method = 'hydrate'.$studlyProperty;
$instance->{$method}($value, $request);
}
$publicProperties = $instance->getPublicPropertiesDefinedBySubClass();
foreach ($publicProperties as $property => $value) {
$studlyProperty = str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $property)));
$method = 'dehydrate'.$studlyProperty;
$instance->{$method}($value, $response);
foreach ($publicProperties as $property => $value) {
$studlyProperty = str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $property)));
$method = 'dehydrate'.$studlyProperty;
$instance->{$method}($value, $response);
}
if (! ctype_lower($value)) {
$value = preg_replace('/\s+/u', '', ucwords($value));
$value = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $value));
}
if (! ctype_lower($value)) {
$value = preg_replace('/\s+/u', '', ucwords($value));
$value = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $value));
}
{
private function formatPropertyName(string $offset): string
{
return str_replace('_', '', lcfirst(ucwords($offset, '_')));
}
private function formatPropertyName(string $offset): string
{
return str_replace('_', '', lcfirst(ucwords($offset, '_')));
}
$namespace = array_map(
function ($part) {
$part = Preg::replace('/[^a-z0-9]/i', ' ', $part);
$part = ucwords($part);
return str_replace(' ', '', $part);
},
function ($part) {
$part = Preg::replace('/[^a-z0-9]/i', ' ', $part);
$part = ucwords($part);
return str_replace(' ', '', $part);
},
private function capitalizeHeaderName(string $name): string
{
$name = str_replace('-', ' ', $name);
$name = ucwords($name);
return str_replace(' ', '-', $name);
}
}
{
$name = str_replace('-', ' ', $name);
$name = ucwords($name);
return str_replace(' ', '-', $name);
}
}