Home >Backend Development >PHP Tutorial >How to get the latest news from twitter in php_PHP tutorial
This article describes the method of getting the latest news from twitter in php. Share it with everyone for your reference. The specific implementation method is as follows:
3 10 11 |
<🎜>function get_status($twitter_id, $hyperlinks = true) {<🎜>
<🎜>$c = curl_init();<🎜>
<🎜>curl_setopt($c, CURLOPT_URL, "http://twitter.com/statuses/user_timeline/$twitter_id.xml?count=1");<🎜>
<🎜>curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);<🎜>
<🎜>$src = curl_exec($c);<🎜>
<🎜>curl_close($c);<🎜>
<🎜>preg_match('/ |