$url="https://sms.globehost.in/api/otp.php"; $postData = array( 'authkey' => $YOUR_AUTH_KEY, 'mobile' => $RECEIVER_MOBILE_NUMBER, 'message' => urlencode("MESSAGE"), 'sender' => $YOUR_SENDER_ID, 'otp' => $otp ); $ch = curl_init(); curl_setopt_array($ch, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $postData //,CURLOPT_FOLLOWLOCATION => true )); //Ignore SSL certificate verification curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); //get response $output = curl_exec($ch); //Print error if any if(curl_errno($ch)) { return false; } else{ return true; } curl_close($ch);