// Assume that we have an array of country data $countries = array( array('id' => 1, 'name' => 'USA'), array('id' => 2, 'name' => 'Canada'), array('id' => 3, 'name' => 'Mexico') ); function getNameById($id, $countries) { foreach($countries as $country) { if($country['id'] == $id) { return $country['name']; } } return null; // Return null if no matching country is found } echo getNameById(2, $countries); // Output: CanadaIn this example, the getNameById function takes two parameters: the ID number of the country and an array of country data. It loops through the array to find the matching ID and returns the name of the country. If no matching country is found, the function returns null. It is important to note that this code snippet is not part of any package library. The getNameById function can be created as a standalone function or as part of a larger application. However, there are many PHP packages and libraries available that provide similar functionality for working with country data, such as the League's ISO 3166 package.