function add_numbers($numeric_array) { $r = 0; foreach($numeric_array as $v) { if(is_numeric($v)) { $r += $v; } } return $r; }