PHP String Function 8027949
PHP String Function 8027949
ADMEC MULTIMEDIA
Leader in Animation & Digital Media Education
ISO 9001:2008 CERTIFIED | ADOBE Testing Center
www.admecindia.co.in
PHP string function helps us to manipulate string in
various ways.
1.echo
2.strtolower ( )
3.strtoupper ( )
4.lcfirst()
5.ucfirst()
6.ucwords()
7.substr_replace ( )
1. echo: It is used to print one or more string .Echo
function is faster than print print function.
Example:
<!doctype <!DOCTYPE html>
<html>
<head>
<title>string function</title>
</head>
<body>
<?php
echo "String Function"
?>
</body>
</html>
Output:
String Function
//echo is not actually function so we are not required to use
parentheses with it.
2. strtolower: It converts a string to lower case letter.
Example:
Output:
string function
3. strtoupper ( ): It converts a string to upper case
letter.
Example:
Output:
STRING FUNCTION
4. lcfirst( ): It converts the first character of a string to
lower.
Example:
Output:
string Function
5. ucfirst( ): It converts the first character of a string
to upper case.
Example:
Output:
String function
6. ucwords( ): It converts the first character of every
word to upper case.
Example:
Output:
String Function
7. substr_replace( ): It replaces a part of a string
with another string.