Tag Info

New answers tagged


First find the location of '#' as strt with InStr(), indexOf(), etc. (I don't know the PHP function to do that, so I am generalizing.) Next find the index of the next white-space, starting at strt + 1 If none, the word is from strt + 1 to the end of the string. But if you find the location, your word is the substring from strt + 1, to that location.


As yu can see below, I converted string to array and then I iterated through this array to find word containg # sign. There is big chance that you can do it in easier way as PHP is not my favourite language. <?php $myString = "Hi #test Please Help me ..i m getting this issue again & again"; $ary = explode(' ', $myString); foreach ($ary as $word) { ...


Not sure if this is good enough for your use case, but i guess you could always add extra tagged people in a comment on the original post.

Top 50 recent answers are included