add character after x characters in php code example Example: add character after x characters in php $newstr = substr_replace($oldstr, $str_to_insert, $pos, 0);