private function getScore($array, $key) { $score = 0; if (array_key_exists($key, $array)) { $score = $array[$key]; } return $score; }