So, I use preg_match to get the text after # up to the place in the line. However, if there are several cases in a string, it will return only the first. This is what I still have
$text = '#demo1 #demo2 some text #blah2';
$check_hash = preg_match("/([#][a-zA-Z-0-9]+)/", $text, $hashtweet);
foreach ($hashtweet as $ht){
echo $ht;
}
echo $ht;prints #demo1#demo1when it should print all 3 C # words in front. Any help is appreciated.
source
share