This question already has an answer here:
I want to select a word that as hash using preg_match in php.
For Example consider this string:
Facebook has re-designed #timeline and it is out in New Zealand
Now I want to select #timeline how to do that, I use this code but it select only #t
preg_match_all("/#[a-zA-Z0-9]/")
Thanks in advance :)
</div>
It's currently only set up to select a single character following the #. Try this:
preg_match_all("/#[a-zA-Z0-9]+/")