Showing posts with label How to use CURL in PHP. Show all posts
Showing posts with label How to use CURL in PHP. Show all posts

Saturday, 21 June 2014

CURL in PHP


CURL in PHP

Read data from other websites.
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // optional
curl_setopt($ch, CURLOPT_CONNECTIONTIMEOUT,$time); // optional
$data = curl_exec($ch);
curl_close($ch);
echo $data;