Getting started with the Twilio PHP library
When you use one of Twilio's API libraries instead of working directly with more low-level HTTP requests, you'll interact with Twilio using simpler code that abstracts away details such as forming URLs, authenticating, and catching errors.
Twilio offers libraries in most major languages, but we'll look at PHP in order to stay in sync with Chapter 1, Working with TwiML.
The principles will be similar if you're using another language, but the syntax and grammar will be different. To see Twilio in action in Ruby, Python, C#, Java, Node.js, and Apex, head to Chapter 5, Twilio in your language.
Downloading the PHP library
First, you'll need to download the library. There are two options for doing this, which are matched across most languages you might use.
Downloading the code manually
Twilio publishes the source code for its API libraries on GitHub (https://github.com). GitHub is the most popular platform for online sharing and...