'getting twitter username with access token

I've a php application and successfully create a function to save access tokens and secrets in the database. (It's about sending specific content to their profile)

I want to show them which twitter account they linked to my application. How can I get their twitter user with access token?

Thanks for help.



Solution 1:[1]

Use this instead:

$credentials = $connection->get('account/verify_credentials')

and then to get username, name, and location-

$name = $credentials->name;

$username = $credentials->screen_name;

$location = $credentials->location;

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Cris