Hi all,
could I request a little help with some PHP regex, please?
I’ve bodged together this bit of code:
echo preg_replace(“/(”.$searchtext.“)/i”, “< b >$1</ b>”, $result[‘output’]);
How could I write this so all $searchtext is made bold except URLs?
At the moment, the < b> tag is applied to all search terms including anything within a href tag meaning the URL is then modified and no longer works.
Thank you.
++edit
modified the b tag so it didn’t make the tags in the post bold…