How can I count the number of element inside an array with value equals a constant? example,
$myArray = array("Kyle","Ben","Sue","Phil","Ben","Mary","Sue","Ben");
how can I directly know how many "Ben" is inside?
$array = array("Kyle","Ben","Sue","Phil","Ben","Mary","Sue","Ben");
$counts = array_count_values($array);
echo $counts['Ben'];