Substr_replace funtion:
Substr_replace is used to replace text within a portion of a string
Syntax : string substr_replace ( string string, string replacement, int start [, int length])
substr_replace() replaces a copy of string delimited by the start and (optionally) length parameters with the string given in replacement. The result is returned.
Example :
<?php
$input = ‘Welcome user’;
echo “Input Text: $input<hr>\n”;
echo “Output Text: <br>\n”;
echo substr_replace($input, ‘john’, 7) . “<br>\n”;
echo substr_replace($input, ‘Hello’, 0, 7) . “<br>\n”;
?>
