PROJET AUTOBLOG


Shaarli - Les petits liens d'Alda

Site original : Shaarli - Les petits liens d'Alda

⇐ retour index

How to remove empty values from array in PHP?

dimanche 28 février 2016 à 11:21
Comment se compliquer la vie inutilement plutôt.

`array_filter($array)` est suffisant, il suffit de [lire le manuel][1] :

> If no callback is supplied, all entries of array equal to FALSE (see [converting to boolean][2]) will be removed.

[1]: http://php.net/manual/en/function.array-filter.php
[2]: http://php.net/manual/en/language.types.boolean.php#language.types.boolean.casting
(Permalink)