Sending an SMS using the PHP/HTTP API

  1. <?php 
  2. /* Include SendsmsApi class */
  3. require_once("sendsms_api.php");
  4.  
  5. $api new SendsmsApi();
  6. $api->setUsername("demouser");
  7. $api->setPassword("demouser");
  8.  
  9. $result $api->message_send("27111234567""Hello""27111236846");
  10.  
  11. if($api->ok($result)) {
  12.     echo "Message sentID was {$result['details']}\n";    
  13. else {
  14.     /* There was an error */
  15.     echo $api->getError();
  16. }
  17.  
  18. ?>