Sorry,
reposting with HTML tags quoted:
====================================
Hi,
I have the following piece of PHP code:
$txt="With an Internet Explorer you can find anything on the Web. This is a URL the information will be passed to the default browser for opening. Almost anything, I should say. Internet is a mess.";
$txt = preg_replace('/((.{0,10})(anything)(.{0,10}))/i', '<I>\1</I>',$txt);
preg_replace should surround all occurences of "anything" together with 10 chars to the left and to the right with <I> tags.
it all works fine. and the HTML output of $txt variable looks like:
With an Internet Explorer you<I> can find anything on the We</I>b. This is a URL the information will be passed to the default browser for openin<I>g. Almost anything, I should</I> say. Internet is a mess.
now, the question is:
would it be possible, using the same preg_replace function to get rid of the remaining string? I.e. - to get rid of the string which remained outside <I> tags?
Thanks,
Temuri