Skip to content

Instantly share code, notes, and snippets.

@hackerrahul
Last active March 6, 2019 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hackerrahul/5026c6966e0f0039d72d2414ec2b97ab to your computer and use it in GitHub Desktop.
Save hackerrahul/5026c6966e0f0039d72d2414ec2b97ab to your computer and use it in GitHub Desktop.
<?php
function send_sms($senderid,$number,$message,$route){
$message = urlencode($message);
$api_key = "YOUR_API_KEY";
$url = 'https://api.paysify.com/send_sms?api_key='.$api_key.'&sender_id='.$senderid.'&number='.$number.'&message='.$message.'&route='.$route.'';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
$response = json_decode($result,true);
curl_close($ch);
return $response;
}
$data = send_sms("PAYSFY","MOBILE_NUMER","hello demo message!","ROUTE_1_OR_4");
echo "<pre>";
print_r($data);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment