PHP string manipulation, inside the string
Posted
by
James
on Stack Overflow
See other posts from Stack Overflow
or by James
Published on 2011-01-02T19:52:15Z
Indexed on
2011/01/02
20:53 UTC
Read the original article
Hit count: 527
I have string:
ABCDEFGHIJK
And I have two arrays of positions in that string that I want to insert different things to.
Array
(
[0] => 0
[1] => 5
)
Array
(
[0] => 7
[1] => 9
)
Which if I decided to add the #
character and the =
character, it'd produce:
#ABCDE=FG#HI=JK
Is there any way I can do this without a complicated set of substr
?
Also, #
and =
need to be variables that can be of any length, not just one character.
© Stack Overflow or respective owner