/ Published in: PHP
URL: http://www.digimantra.com/technology/php/get-data-from-a-url-using-curl-php/
Expand |
Embed | Plain Text
<?php $url='http://twitter.com/statuses/user_timeline/16387631.json'; //rss link for the twitter timeline /* gets the data from a URL */ function get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); $data = curl_exec($ch); curl_close($ch); return $data; } ?>
You need to login to post a comment.
