Ver Mensaje Individual
  #4 (permalink)  
Antiguo 19/10/2009, 21:49
Avatar de gjx2
gjx2
 
Fecha de Ingreso: agosto-2008
Ubicación: R.D
Mensajes: 1.153
Antigüedad: 15 años, 8 meses
Puntos: 139
Respuesta: quitar valores en blanco o nulos de un array

La misma logica pero SIN ERRORES



Código php:
Ver original
  1. $numeros = array("uno","dos","tres","cuatro","","");
  2.    
  3.    
  4.        
  5.        
  6.         function DelNull($matrix){
  7.        
  8.            
  9.             foreach($matrix as $rows){
  10.        
  11.                 if(!empty($rows)){
  12.            
  13.                     $val[] = $rows;
  14.                 }
  15.             }
  16.        
  17.         return $val;
  18.            
  19.            
  20.         }
  21.  
  22.  
  23. echo count(DelNull($numeros));