Zend - The PHP Company




Arrays

Add Code


counting and printing the value in an array  

Type: code fragment
Added by: sultanzahir
Entered: 16/11/2001
Last modified: 02/11/2000
Rating: - (fewer than 3 votes)
Views: 5318
it first browse through the array and than print it out also in an array function.very useful when one is working with MYSQL


<?
$array 
= array("PHP",1,"PHPList",1,"openIT");
$number array_count_values($array);  while(list($key$val) = each($number)) {
  echo 
$key " - " $val "<br>";}
?>


Usage Example




Rate This Script





Search



This Category All Categories