PHP string function problem

Associate
Joined
24 Aug 2003
Posts
1,486
Location
Derbyshire
I have a series of (different) strings, I wish to perform an insert/replace (replace \n (newline characters with some text) on each of the strings but only between certain points/indices in them.

I'm currently carrying out a horrible mess of searching, sub string copying, preg'ing and reinsterting.

Can anyone suggest a better way - I've been trying to find a single function to do it - basically a "preg_replace" but only between certain points.
 
Cheers :)

I got into work this morning to find they changed the spec of what they wanted, :rolleyes: in the end I did something similar to what you suggested, just a little less elegantly due to some extra string trimming and extra concatenation I had to carry out.

thanks again
 
Back
Top Bottom