Hi,
Does anyone have any ideas on how to go about doing this.
$s = 'This is a \n long string :markstart: This is the \ndata I \nwant to edit:markend: and the rest \nof the string';
I want to strip out the \n characters from only inside the markers :markstart: :markend: but not from anywhere else in the string. The string may also have many :markstarts: and ends in it, so am trying to do all in 1 pass if possible.
So far, I can get all the substrings using eregi() and can strip out the \n's but cant think of a way to place back into the string at the correct place.
Using eregi_replace, I can get the contents inside the markers, but cant manipulate the parameter \1 to strip out the \n's as the paramater does not seem reference the data until eregi_replace has entered the data back into the string...if that makes sense.
Any ideas would be great.
Thanks in advance.