function clean_array($array) { foreach ($array as $key => $value) { if ($value == NULL) { unset($array[$key]; continue; } } }