PHP Classes

File: voxoxtest.php

Recommend this page to a friend!
  Classes of Christopher Cilley   Voxox SMS   voxoxtest.php   Download  
File: voxoxtest.php
Role: Example script
Content type: text/plain
Description: Test sending SMS
Class: Voxox SMS
Send SMS multiple SMS messages at once using Voxox
Author: By
Last change: Removed call to include to "global_cdc.php". This was a call to a local utility library left over from my testing. It is not needed for the package.
Date: 8 years ago
Size: 807 bytes
 

Contents

Class file image Download
<?php
require_once 'class_VoxoxSMS.php';

$apiKey = '<YOUR VOXOX API KEY HERE>';

$smsVox = new VoxoxSMS ( $apiKey, false, true, false );

// Phone numbers are 11 digits : 1<area code><number>
$smsArray = array ();
$smsArray ['16195551212'] = 'test to 1213';
$smsArray ['16195551213'] = 'test to 1214';
$smsArray ['16195551214'] = 'test to 1215';
echo
"Send to array of phone numbers:\n";
print_r ( $smsArray );

list (
$succeed, $fail ) = $smsVox->sendSMSMulti ( $smsArray );
echo
"# succeed = $succeed\n";
echo
"# failed = $fail\n";

echo
"\n\nSend to single phone number:\n";
$testNumber = '16195551212';
$testMessage = 'Single number test';
list (
$success, $errMsg ) = $smsVox->sendSMS ( $testNumber, $testMessage );
if (
$success)
    echo
"succeed\n";
else
    echo
"failed\n";
?>