Make the first character of a string in uppercase.
Using PHP ucfirst() function we can uppercase the first character of a string. PHP has this inbuilt function to uppercase the first letter of any string. Look at the below code for better explaination:
Using PHP ucfirst() function we can uppercase the first character of a string. PHP has this inbuilt function to uppercase the first letter of any string. Look at the below code for better explaination:
The output of the above code will be:PHP Code:<?php
$STRING = "hello, i love this website.";
$STRING = ucfirst($STRING);
echo $STRING;?>
Code:Hello, i love this website.
No comments:
Post a Comment