Answers for "php eliminar elementos vacios array"

PHP
1

php eliminar elementos vacios array

// La función array_filter permite eliminar los valores vacíos en un array.
// Sintaxis: array array_filter ( array $input [, callback $callback ] )
// Si no se pasa el callback, elimina todos los valores iguales a FALSE.

$array = array("",2,0,"huelva","");
print_r(array_filter($array));

// Resultado:
// Array ( [1] => 2 [3] => huelva )
Posted by: Guest on June-11-2020

Code answers related to "php eliminar elementos vacios array"

Browse Popular Code Answers by Language