• 0

Detecting @replies and #tags in PHP


Question

I'm rewriting the twitter module I wrote for my website, to autolink @replies and #hashtags from my twitter feed. This worked fine when it didn't use a loop to detect more than one of each, but when I rewrote it to detect ALL replies/tags, it started to show problems. For instance, I posted " I @think #I @have #it @working #now", and it only detected "#now".

The script's source is here: http://pastie.org/599060

Can anyone tell me what I'm doing wrong here?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

As the site's not loading, here's an idea for it:

preg_replace(' ...whatever it starts with... \@(all A-z 0-9 chars) ...whatever preg ends in...', 'http://twitter.com/$1',$tweet);

That might help?

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.