Papa De Beau Papa De Beau - 2 months ago 5
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


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.