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.
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.