<?php $id = "asdfasdf"; $id = substr_replace( $id, "00", 3, 2); print "New id number: $id<br/>"; ?>
Output:
New id number: asd00sdf<?php $mystring = substr_replace("Hello World", "asdf", 0, 0); echo $mystring . "<br />"; $mystring = substr_replace("Hello World", "0 w0", 4, 4); echo $mystring; ?>
Output :
asdfHello World
Hell0 w0rld
Hell0 w0rld
<?php $favs = " is good boy."; $name = "Ram"; $favs = substr_replace($favs, $name, 0, 0); print $favs; ?>
Output :
Ram is good boy.
No comments:
Post a Comment