$newstr = substr_replace($oldstr, $str_to_insert, $pos, 0);
http://php.net/substr_replace
In the above snippet, $pos
is used in the offset
argument of the function.
offset
If offset is non-negative, the replacing will begin at the
offset'th offset into string.
If offset is negative, the replacing will begin at the offset'th
character from the end of string.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…