Get minimum value from an array that contains null values
Use array_diff()
to exclude null
values and after this process use min()
:
$r = array_diff(array(10, 20, null, 60), array(null));
min($r);
Use array_filter()
as a wrapper with strlen
as call-back..
echo min(array_filter($arr,'strlen'));
Demonstration