Answers for "remove empty elements from index with keys array php"

PHP
0

remove empty array elements php

$colors = array("red","","blue",NULL);

$colorsNoEmptyOrNull = array_filter($colors, function($v){ 
 return !is_null($v) && $v !== ''; 
});
//$colorsNoEmptyOrNull is now ["red","blue"]
Posted by: Guest on October-30-2019

Code answers related to "remove empty elements from index with keys array php"

Browse Popular Code Answers by Language