All About Computer And Life

Talk Only

Your Ad Here

PHP Get URL Content

This code whill show you how to get url content

<?
//http://www.gunungpring.com

//save as getURL.php
function getURL($url) {
$curlHandle = curl_init(); // init curl
$apiCallUrl = $url;

curl_setopt($curlHandle, CURLOPT_URL, $apiCallUrl); // set the url to fetch
curl_setopt($curlHandle, CURLOPT_HEADER, 0);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlHandle, CURLOPT_TIMEOUT,120);
$content = curl_exec($curlHandle);
curl_close($curlHandle);
return $content;
}
$grab = getURL(”http://www.gunungpring.com/wordpress/index.php”);
echo $grab;
?>

Your Ad Here

Leave a Comment

Home

Where am I?

You’re currently at “PHP Get URL Content,” an entry on Talk Only by admin on Apr 11 2007 @ 12:56 pm