1//string to all uppercase
2$string = "String with Mixed use of Uppercase and Lowercase";
3//php string to uppercase
4$string = strtoupper($string);
5// = "STRING WITH MIXED USE OF UPPERCASE AND LOWERCASE"
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$lowercase = "this is lower case";
2$uppercase = strtoupper($lowercase);
3
4echo $uppercase;
1<?php
2/* Convert the first character of "hello" to uppercase: */
3echo ucfirst("hello samy!");
4
5//output : Hello samy!
6?>
1
2<?php
3$foo = 'bonjour tout le monde!';
4$foo = ucfirst($foo); // Bonjour tout le monde!
5
6$bar = 'BONJOUR TOUT LE MONDE!';
7$bar = ucfirst($bar); // BONJOUR TOUT LE MONDE!
8$bar = ucfirst(strtolower($bar)); // Bonjour tout le monde!
9?>
10
11