The custom phone number validator uses Twilio's Lookup API to validate phone numbers in national and international formats. It makes a request to the API with the provided phone number, and if the request returns valid details, it confirms that the phone number is valid; otherwise, it indicates that the number is not valid. The validator simplifies interacting with the Lookup API by using Twilio's PHP helper library and only validates two formats: national and international. It also stores the country code of the phone number to make the request more specific if necessary.