onyourmark
asked on
PHP and CURL
Hi, I have the following script. I am trying to access
http://search.twitter.com/search?q=Japan
and have the results written to a file, but the file is empty. Can anyone see why and how I can fix it?
Thanks.
http://search.twitter.com/search?q=Japan
and have the results written to a file, but the file is empty. Can anyone see why and how I can fix it?
Thanks.
<?php
$curl = curl_init();
$fp = fopen("somefile.txt", "w");
curl_setopt ($curl, CURLOPT_URL, "http://search.twitter.com/search?q=Japan");
curl_setopt($curl, CURLOPT_FILE, $fp);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec ($curl);
curl_exec ($curl);
curl_close ($curl);
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.