array_filter

array_filter

array_filter($required_args, function($val){ return !($val === null || (is_array($val) &&
!$val));});