Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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 )
Comment

PREVIOUS NEXT
Code Example
Php :: laravel migration index 
Php :: php empty array 
Php :: php delete json object from a collection object 
Php :: display all errors in blade laravel 
Php :: how to redirect to another page in php 
Php :: php stop execution 
Php :: save an image use php 
Php :: wp php get_the_category posts loop 
Php :: --prefer-dist what is use in laravel 
Php :: how to use flash message in laravel 
Php :: laravel try catch example 
Php :: how validate the becrypt password in laravel 
Php :: php cloudflare get country from IP 
Php :: cakephp 2.x join 
Php :: using php, how to create a folder in another folder 
Php :: how to call a helper function in blade 
Php :: str_contains 
Php :: how to make db seeder in laravel 
Php :: array unique php 
Php :: wordpress change language of specific text php 
Php :: File Reading Modes PHP 
Php :: foreign key laravel migration 
Php :: php utc time 
Php :: string to boolean php 
Php :: laravel collection slice 
Php :: laravel log build custom channel 
Php :: laravel fixed character limit 
Php :: carbon now 
Php :: php string slice 
Php :: web api return json example in php 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =