Twitter does not free access to user’s email, soon you will not be able to get that information from the API
from Twitter. Instead, you have to get this information on the registration form.
// a lib necessárias
require_once('TwitterAPIExchange.php');
// define suas configurações de acesso
$settings = array(
'oauth_access_token' => "SEU_ACCESS_TOKEN",
'oauth_access_token_secret' => "SEU_ACCESS_TOKEN_SECRET",
'consumer_key' => "SEU_CONSUMER_KEY",
'consumer_secret' => "SEU_CONSUMER_SECRET"
);
// escolha a url que você precisa da documentação, essa é a users/show
$url = 'https://api.twitter.com/1.1/users/show.json';
// o método de requisição, de acordo com a documentação é GET e não POST
$requestMethod = 'GET';
// definindo sua string
$getfield = '?screen_name=j7mbo';
// criando o objeto
$twitter = new TwitterAPIExchange($settings);
// faz a requisição e obtem a resposta dentro da variável $json
$json = $twitter->setGetfield($getfield)
->buildOauth($url, $requestMethod)
->performRequest();
// transforma tudo para um array json
$result = json_decode($json);
// mostrando/acessando a profile_image_url
echo $result->profile_image_url;
Thanks for the clarification Paulo Costa !
– Hector Cardoso
$getfield = '?screen_name=j7mbo'; is my user’s name ? Another question : I am testing on localhost and giving SSL problem : Fatal error: Uncaught Exception 'Exception' with message 'SSL Certificate problem: Unable to get local Issuer Certificate' in C: xampp htdocs socialplugins signin-twitter\twitter-api-php\TwitterAPIExchange.php:296 Stack trace: 
#0 C:\xampp\htdocs\socialplugins\signin-twitter\twitter-api-php\index.php(31): 
TwitterAPIExchange->performRequest() #1 {main} thrown in 
C:\xampp\htdocs\socialplugins\signin-twitter twitter-api-php Twitterapiexchange.php on line 296.
– Hector Cardoso
what may be generating this error ?
– Hector Cardoso