This is a good question, I myself struggled with this.
You can use the Twitter API client via PHP and then json_encode the user timeline you want and analyze it. This is not the best practice, but this is the work that I had to do for an application on which I wanted to show only tweets, no other actions are needed, for example, getting links, retweets, etc.
I hope this will serve.
source share