So i have this here
<? $regex = array('/@(\w+)/','/#(\w+)/','/((www|http:\/\/)[^ ]+)/');
$replace = array(
'<a href="https://www.twitter.com/$1">@$1</a>',
'<a href="https://twitter.com/#!/search/%23$1">#$1</a>',
'<a href="\1">\1</a>'
); ?>
<?= preg_replace($regex,$replace,stripslashes($row['tweet_text']));?>
The first two are suppose to turn anything with @ and # into links. This is obviously for twitter. But the third is supposed to turn anything with http or www into a link. But it seems to be conflicting with the first two messing up the links.
How can i make the third one make http or www links without conflicting the other two?