Papa De Beau Papa De Beau - 1 year ago 81
PHP Question

Twilio php get from number when receiving sms

Using Twilio and a php script how do I get the from number and body data from an incoming sms?

I have a paid account. My incoming texts are being sent to my php script via twilio but I just need to know how to get the number and body.

This should be easy but its not.

<? // my script

$from = ???;
$body = ???;


Please provide a php example if you can because I don't understand their api with no examples. Thanks

Answer Source

Twilio evangelist here.

Parameters are passed from Twilio as form-encoded data, so you can use PHP's $_REQUEST object:


Check out this Quickstart for a longer example:

Hope that helps.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download