Академический Документы
Профессиональный Документы
Культура Документы
ADMEC MULTIMEDIA
Leader in Animation & Digital Media
Education
ISO 9001:2008 CERTIFIED | ADOBE Testing Center
www.admecindia.co.in
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.
Output:
string function
Output:
STRING FUNCTION
Output:
string Function
Output:
String function
Output:
String Function
Output:
hello nandon
//here it replace world to nandon . Number 6 means the
replacement starts from 6 position of the string.
Example 2:
<!doctype <!DOCTYPE html>
<html>
<head>
<title>string function</title>
</head>
<body>
<?php
echo substr_replace("hello world", "nandon",-5);
?>
</body>
</html>
Output:
hello nandon
//here in this example we use (-) negative sign so it will
count the word from the right hand side and replace.
ADMEC MULTIMEDIA
Leader in Animation & Digital Media Education
ISO 9001:2008 CERTIFIED | ADOBE Testing Center
http://www.admecindia.co.in