Friday, 20 March 2009

Reading URL in PHP

This was the most used code for me in my mobile apps/services application. As I work with a number of sms gateway providers and affiliates, which required often to use their services from my application(web apps), I used a service-url(developed on any technology) in PHP application in following way. This is simple aint it?

function curl_get_file_contents($URL)
{
$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_URL, $URL);
$contents = curl_exec($c);
curl_close($c);
if ($contents) return $contents;
else return FALSE;
}
?>

No comments:

Efficient and Reliable UI automation without Selenium

I have been experiencing satisfaction over UI automation efforts after a half-decade of my work in automation. The reason is new age tools ...