How would i add both of these preg_replace together? I am lost on how to do it.
<?= preg_replace('/@(\w+)/', '<a href="https://www.twitter.com/$1">@$1</a>', stripslashes($row['tweet_text']))?>
<?= preg_replace('/#(\w+)/', '<a href="https://twitter.com/#!/search/$#$1">#$1</a>', stripslashes($row['tweet_text']))?>
and it would do both these things for
stripslashes($row['tweet_text']
You can do this:
Check the docs: http://php.net/manual/en/function.preg-replace.php
Also, here’s a sweet example.