Install dependencies via composer:
$ composer install
Create a php file with the following contents:
// Autoload composer files and require the API interface
require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/twitterApi.php';
// Create a new instance
$twitter = new Twitter($config = array(
'consumer_key' => '',
'consumer_secret' => '',
'user_token' => '',
'user_secret' => '',
'screen_name' => ''
));
// Get the 10 latest tweets
// Consult the twitterApi.php file for more methods
$data = $twitter->get(10);
// Output as JSON
header('Content-Type: application/json');
echo json_encode($data);