function count($array){
$counter=0;
foreach($array as $key=>$value){
if(is_array($value)){
count($value);
}else{
if(strcmp($value, "Hi") == 0){
$counter++;
}
}
}
}
$arrays = array("Hi", "a", "Hi", "b", "c", array("c", "Hi", array("Hi"), "d"));
If I call count($arrays);
I want to print 4 in this case.
But my code keeps printing 0.
It seems it does not return counter of "Hi" properly but I have no idea.