capitalize string in php code example
Example 1: php string to uppwe
$lowercase = "this is lower case";
$uppercase = strtoupper($lowercase);
echo $uppercase;
// THIS IS LOWER CASE
Example 2: ucfirst() php
<?php
$foo = 'hello world!';
$foo = ucfirst($foo); // Hello world!
$bar = 'HELLO WORLD!';
$bar = ucfirst($bar); // HELLO WORLD!
$bar = ucfirst(strtolower($bar)); // Hello world!
?>
// string manipulation function