File: /home/imensosw/www/imenso.co/dev/twillio/index.php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.twilio.com/2010-04-01/Accounts/ACd38e1aff748bd88ce76e41619cde0f70/Messages',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('To' => '+91919977808469','From' => '+16012733100','Body' => 'This is a test message'),
CURLOPT_HTTPHEADER => array(
'Authorization: Basic QUNkMzhlMWFmZjc0OGJkODhjZTc2ZTQxNjE5Y2RlMGY3MDphYzFiYTEwY2ExN2Q2N2E3YmIyMDliZDQwZjI0OTI5YQ=='
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;