I need to know how can I make a string like "hello"to "hello"using PHP? I just need the first character Upper
"hello"
use function ucwords(); This will do every word in a line, using ucfirst()will just make the first word.
ucwords()
ucfirst()
echo ucwords('hello my name is jim'); // Hello My Name Is Jim echo ucfirst('hello my name is jim'); // Hello my name is jim
You need a function ucfirst.
ucfirst
Returns a string with the first character str, uppercase if this character is alphabetic.
It will not make other characters lowercase. To make sure that only the first letter is uppercase and all the rest are lowercase letters you can make:
ucfirst(strtolower($str))
. , .
: char
Usage: ucfirst ("first char of string"); // output First char of string
For: all first char words in a string
Usage: ucwords ("all first char words in a string") // prints All First char Word In String
Source: https://habr.com/ru/post/1740429/More articles:Hadoop 0.2: How to read exits from TextOutputFormat? - mapreduceHow to debug a crash when starting my garbage collector in Rosetta? - garbage-collectionOdd behavior json_decode () - jsonUnable to iterate through an object in Ubuntu PHP 5.2.10-2 Works on PHP 5.2.10? - phpВ чем разница между клиентским и серверным тестированием при выполнении различных тестов? - client-sidehow to get substring from string with variable character length in php? - stringMVC: submit one form from a page with multiple forms - c #user uitableviewcell for login - username and password - uitableviewStep by step validation using jquery validation plugin - javascriptA tab made in a transaction is visible to SELECT before the transaction is completed - sqlAll Articles