$foo = 'hello world!'; $foo = ucwords($foo); // Hello World! $bar = 'HELLO WORLD!'; $bar = ucwords($bar); // HELLO WORLD! $bar = ucwords(strtolower($bar)); // Hello World! //With custom delimiter $foo = 'hello|world!'; $bar = ucwords($foo); // Hello|world! $baz = ucwords($foo, "|");
<?php $foo = 'hello world!'; $foo = ucfirst($foo); // Hello world! $bar = 'HELLO WORLD!'; $bar = ucfirst($bar); // HELLO WORLD! $bar = ucfirst(strtolower($bar)); // Hello world! ?>
$upperCaseSentance=ucwords("i do not feel good");//I Do Not Feel Good
ucfirst("hello world!");
$clientname = "ankur prajapati"; ucwords($clientname);//Ankur Prajapati