Created
March 11, 2024 19:32
-
-
Save maestrojed/484aef483f73173325650fa6c2a5a54e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$api_key = ""; | |
$ph_number = ""; | |
// Initialize cURL. | |
$ch = curl_init(); | |
// Set the URL that you want to GET by using the CURLOPT_URL option. | |
curl_setopt($ch, CURLOPT_URL, 'https://phonevalidation.abstractapi.com/v1/?api_key='%api_key'&phone='.$ph_number); | |
// Set CURLOPT_RETURNTRANSFER so that the content is returned as a variable. | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
// Set CURLOPT_FOLLOWLOCATION to true to follow redirects. | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); | |
// Execute the request. | |
$data = curl_exec($ch); | |
// Close the cURL handle. | |
curl_close($ch); | |
//format the JSON into a table (tables can be saved as CSVs). This will be easiest for admins | |
$ph_number_data = json_decode($data); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment