📅  最后修改于: 2022-03-11 14:54:11.678000             🧑  作者: Mango
$colors = array("red","","blue",NULL);
$colorsNoEmptyOrNull = array_filter($colors, function($v){
return !is_null($v) && $v !== '';
});
//$colorsNoEmptyOrNull is now ["red","blue"]