Php > Strings
Sub String Replace
Sub String Replace \n"; /* These two examples replace all of $var with 'bob'. */ echo substr_replace($var, 'bob', 0) . "
\n"; echo substr_replace($var, 'bob', 0, strlen($var)) . "
\n"; /* Insert 'bob' right at the beginning of $var. */ echo substr_replace($var, 'bob', 0, 0) . "
\n"; /* These next two replace 'MNRPQR' in $var with 'bob'. */ echo substr_replace($var, 'bob', 10, -1) . "
\n"; echo substr_replace($var, 'bob', -7, -1) . "
\n"; /* Delete 'MNRPQR' from $var. */ echo substr_replace($var, '', 10, -1) . "
\n"; ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage