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, ∼2096🔥, 0💬
Popular Posts:
How To Read the Entire File into a Single String in PHP? If you have a file, and you want to read th...
How to register and get an application ID from Azure AD? The first step to use Azure AD is to regist...
What's Wrong with "while ($c=fgetc($f)) {}" in PHP? If you are using "while ($c=fgetc($f)) {}" to lo...
How to use the "forward-request" Policy Statement to call the backend service for an Azure API servi...
What Azure AD App Registration Manifest? Azure AD App Registration Manifest is JSON file that contai...