function getIsoById($id) { $countries = [ '1' => 'US', '2' => 'CA', '3' => 'MX' ]; if (isset($countries[$id])) { return $countries[$id]; } else { return null; } } // Usage example: $countryCode = getIsoById(2); // Returns 'CA'In this example, the function takes an ID as an argument and returns the corresponding country code from an associative array. If the ID is not found in the array, the function returns null. This function does not belong to a specific package or library. It is a simple custom function that can be included in any PHP project.