I’ve created a class (based on Jaisen Mathai’s oAuth classes) for easiest use of Twitter – for authentication! Have a look on implementation:
<?php
session_start();
// authenticate twitter users
require_once 'twitterWrapper.php';
$myT = new twitterWrapper();
$myT->authenticate();
// security check done. To print the user's Twitter username, you can call:
echo "Thanks for authenticating yourself, " . $myT->getIdentifier();
?>
A detailed usage can be viewed here. To grab the class from free, Download it from PHP Classes Site!