Q:

first letter capital of every word in php

$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, "|"); 
5

<?php
$foo = 'hello world!';
$foo = ucfirst($foo);             // Hello world!

$bar = 'HELLO WORLD!';
$bar = ucfirst($bar);             // HELLO WORLD!
$bar = ucfirst(strtolower($bar)); // Hello world!
?>

2
$upperCaseSentance=ucwords("i do not feel good");//I Do Not Feel Good
6
ucfirst("hello world!");
3
$clientname = "ankur prajapati";
ucwords($clientname);//Ankur Prajapati
1

New to Communities?

Join the community