function hashTagFinder($str)
{
$hash= explode(" ", substr($str, strpos($str, "#")));
$i=0;
foreach ($hash as $tag) {
$finder=substr_count($tag, "#");
if ($finder>=1 ) {
$fArray = array([$i]=> $tag);
}
$i++;
}
}
I am a beginner and I want to make a hashtag finder function.
I am trying to do it this way but it looks like I can't use object and arrays to define keys.