Skip to content

Instantly share code, notes, and snippets.

Created March 10, 2018 18:23
Show Gist options
  • Save anonymous/2a15c29faa2f0b70648b4b90e2eb4ae7 to your computer and use it in GitHub Desktop.
Save anonymous/2a15c29faa2f0b70648b4b90e2eb4ae7 to your computer and use it in GitHub Desktop.
<?php
require 'twilio-php-master/Twilio/autoload.php';
use Twilio\Rest\Client;
$to = $_POST['to'];
$msg = $_POST['msg'];
if (substr($to,0,1) == '0') {
$to = '+62'.substr($to,1);
}
$msg = ':
'.$msg.'.
Indra-Cms';
$sid = 'MASUKKAN sid TWILIO DI SINI';
$token = 'MASUKKAN token TWILIO DI SINI';
$client = new Client($sid, $token);
$client->messages->create(
$to,
array(
'from' => 'MASUKKAN nomor dari TWILIO DI SINI',
'body' => $msg
)
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment