Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/11/2012, 20:26
Avatar de xxxivanxxx
xxxivanxxx
 
Fecha de Ingreso: julio-2010
Ubicación: /home
Mensajes: 114
Antigüedad: 13 años, 9 meses
Puntos: 21
Respuesta: Recorrer array y contar valores

Código PHP:
Ver original
  1. $a = array(1,3,7,0,0,5,4,0);
  2. $b = 0;
  3. foreach($a as $n){
  4.    if($n==0) $b++;
  5. }
  6.  
  7. echo $b;
__________________
<?="Hello World"?> -> si te gustÓ dale +1