Chud
0
Q:

php uppercase first letter


<?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 
9

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

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

2
ucwords("hello world"); // Hello World
ucfirst("hello world"); // Hello world
3
<?php
/* Convert the first character of "hello" to uppercase:  */
echo ucfirst("hello samy!");

//output : Hello samy!
?>
2
ucfirst("hello world!");
3
ucfirst($myword);
1

New to Communities?

Join the community