I try to get value after symbol '@' and count it. But this code doesn't give the correct result. How to fix it?
$t="Hi, I invite @nina and @nana to come to my party tomorow";
$arr=explode(' ', $t);
foreach($arr as $user ) {
$result=strstr($user, '@');
$total = $count($result);
}
echo $total;
Result = 1
Expected Result =2