If I have an array:
[null, 'a', 'b', 'c']
I want to get the first non-null value from the array, in this case "a". How could I go about doing that nice and easily?
function getFirstNotNull($array) { foreach($array as $val) { if(!is_null($val) || !$val) return $val; } }