Hello everyone I am trying to validate the mobile number using abstract api validation but I am stuck to check which number is valid and which number is not valid for this I write a code.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://phonevalidation.abstractapi.com/v1/?api_key=my_api&phone=14152007986');
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
$check = (string)$data;
if (strpos($check, 'true') == true)
{
echo "PhoneNo is valid";
}
if (strpos($check, 'false') == false)
{
echo "PhoneNo is invalid";
}
In the above code the phone number is correct as I am giving the phone number as example but still its showing me PhoneNo is invalid can any one help me to create a logic for it