Tools, FAQ, Tutorials:
Converting Leading Characters to Upper Case in PHP
How To Convert Leading Characters to Upper Case?
✍: FYIcenter.com
If you are processing an article, you may want to capitalize the first character of a sentence by using the ucfirst() function. You may also want to capitalize the first character of every words for the article title by using the ucwords() function. Here is a PHP script on how to use ucfirst() and ucwords():
<?php
$string = "php string functions are easy to use.";
$sentence = ucfirst($string);
$title = ucwords($string);
print("$sentence\n");
print("$title\n");
print("\n");
?>
This script will print:
Php string functions are easy to use. Php String Functions Are Easy To Use.
⇒ Comparing Two Strings with strcmp() in PHP
⇐ Converting Strings to Upper/Lower Case in PHP
2016-10-13, ∼2625🔥, 0💬
Popular Posts:
How To Move Uploaded Files To Permanent Directory in PHP? PHP stores uploaded files in a temporary d...
What is Azure API Management Publisher Dashboard? Azure API Management Publisher Dashboard is an Azu...
What is EPUB 3.0 Metadata "dc:publisher" and "dc:rights" elements? EPUB 3.0 Metadata "dc:publisher" ...
How to use .NET CLR Types in Azure API Policy? By default, Azure imports many basic .NET CLR (Common...
How To Convert a Character to an ASCII Value? If you want to convert characters to ASCII values, you...