Changes

Jump to: navigation, search

Working with Strings and Text in PHP

1 byte removed, 17:32, 4 June 2007
Extracting and Replacing Substrings in PHP
The substr_replace function takes up to four arguments. The first is the source string on which the replace is to be performed. The second argument is the replacement string. The third specifies the index offset of the start of the replacement. The optional fourth argument defines number of characters from tyhe offset point to include in the replacement (useful if your replacement text is shorter than the original text being replaced).
We can nopw now extend our example to replace some text in our string:
<pre>

Navigation menu