1
2<?php
3$foo = 'hello world!';
4$foo = ucfirst($foo); // Hello world!
5
6$bar = 'HELLO WORLD!';
7$bar = ucfirst($bar); // HELLO WORLD!
8$bar = ucfirst(strtolower($bar)); // Hello world!
9?>
10
11
1
2<?php
3$foo = 'hello world!';
4$foo = ucfirst($foo); // Hello world!
5
6$bar = 'HELLO WORLD!';
7$bar = ucfirst($bar); // HELLO WORLD!
8$bar = ucfirst(strtolower($bar)); // Hello world!
9?>
10// string manipulation function
11
1<?php
2/* Convert the first character of "hello" to uppercase: */
3echo ucfirst("hello samy!");
4
5//output : Hello samy!
6?>
1$clientname = "ankur prajapati";
2ucwords($clientname);//Ankur Prajapati
3ucfirst($clientname);//Ankur Prajapati
4
5$clientname = "ANKUR PRAJAPATI";
6ucfirst(strtolower($clientname));//Ankur Prajapati