Results 1 to 2 of 2

Thread: how to covert following curl script to php curl script?

Threaded View

  1. #2
    Hyperactive Member xxarmoxx's Avatar
    Join Date
    Mar 2007
    Posts
    378

    Re: how to covert following curl script to php curl script?

    This should work:

    Code:
    $to = "Joe";
    $from = "Momma";
    $body = "body here";
    $url = "https://api.twilio.com/2010-04-01/Accounts/xxx/SMS/Messages.xml?from={$from}&to={$to}&body={$body}";
    $ch = curl_init();
    curl_setopt($ch,CURLOPT_TIMEOUT,5);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $result  = curl_exec($ch);
    curl_close($ch);
    You can echo out $result.

    For further information check out the PHP manual: http://us2.php.net/manual/en/function.curl-exec.php
    Last edited by xxarmoxx; Jul 29th, 2012 at 12:28 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width