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, ∼1987🔥, 0💬
Popular Posts:
How to add request URL Template Parameters to my Azure API operation to make it more user friendly? ...
How to use the "set-variable" Policy Statement to create custom variables for an Azure API service o...
How to use urllib.parse.urlencode() function to encode HTTP POST data? My form data has special char...
How to build a PHP script to dump Azure AD 2.0 Authentication Response? If you are use the Azure-AD-...
Can Multiple Paragraphs Be Included in a List Item? Yes. You can include multiple paragraphs in a si...