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, 1493🔥, 0💬
Popular Posts:
How to use "json-to-xml" Azure API Policy Statement? The "json-to-xml" Policy Statement allows you t...
How to use the Atom Online Validator at w3.org? w3.org feed validation service is provided at http:/...
How To Access a Global Variable inside a Function? in PHP? By default, global variables are not acce...
How to dump (or encode, serialize) a Python object into a JSON string using json.dumps()? The json.d...
How to read Atom validation errors at w3.org? If your Atom feed has errors, the Atom validator at w3...