Insert string at specified position| php
You can use following code to insert string at the specified position.
$newstr = substr_replace($oldstr, $str_to_insert, $pos, 0);http://php.net/substr_replace The 4th argument being "0" causes the replaecment string to be inserted without overwriting any of the original string.