PHP substr_replace Function

What is substr_replace Function?


In PHP, this function is used to replace text within a portion of a string.



In the above syntax given "string" is the input to check, "replacement" specifies the string to insert,
"start" specifies where to start replacing, "length" specifies how many characters to replace.

Example :

echo substr_replace("Hi sam","ram",3);

Result :

Hi ram

PHP Topics

Ask Questions

Ask Question