array_count_values function - how to get array values number of occurrences in php
array_count_valuesfunction.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>array_count_values function - how to get array values number of occurrences in php</title>
</head>
<body>
<h2 style="color:Navy; font-style:italic">php example: using array_count_values function in php</h2>
<hr width="525" align="left" color="DodgerBlue" />
<br />
<?php
$Colors=array("Red","Green","Red","Tan","Red","Olive","Tan","Snow","Maroon","Blue");
echo "<div style='font-size:large;color:OrangeRed'>";
print_r(array_count_values($Colors));
echo "</div>";
?>
</body>
</html>