91-9990449935 0120-4256464 |
PHP String FunctionsPHP provides various string functions to access and manipulate strings. A list of important PHP string functions are given below. 1) PHP strtolower() functionThe strtolower() function returns string in lowercase letter. Syntax Example Output:
my name is khan
2) PHP strtoupper() functionThe strtoupper() function returns string in uppercase letter. Syntax Example Output:
MY NAME IS KHAN
3) PHP ucfirst() functionThe ucfirst() function returns string converting first character into uppercase. It doesn't change the case of other characters. Syntax Example Output:
My name is KHAN
4) PHP lcfirst() functionThe lcfirst() function returns string converting first character into lowercase. It doesn't change the case of other characters. Syntax Example Output:
mY name IS KHAN
5) PHP ucwords() functionThe ucwords() function returns string converting first character of each word into uppercase. Syntax Example Output:
My Name Is Sonoo Jaiswal
6) PHP strrev() functionThe strrev() function returns reversed string. Syntax Example Output:
lawsiaj oonoS si eman ym
7) PHP strlen() functionThe strlen() function returns length of the string. Syntax Example Output:
24
Next TopicPHP Math
|