Refer to this link
I'm using the below code:
$ad['ad_story'] = preg_replace('/<link_me>(.*)<\/link_me>/', '<a rel="nofollow" href="http://$1">http://$1</a>', strip_tags($ad['ad_story'],"<br /><br><link_me></link_me>"),1);
But i do not understand why the whole chunk is being replace instead of 2 different separate links.
Am i missing something. Help definitely appreciated