function curl_get_contents($url) { // from http://www.fusionswift.com/2010/02/curl-vs-file_get_contents/
// Initiate the curl session
$ch = curl_init();
// Set the URL
curl_setopt($ch, CURLOPT_URL, $url);
// Removes the headers from the output
curl_setopt($ch, CURLOPT_HEADER, 0);
// Return the output instead of displaying it directly
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Execute the curl session
$output = curl_exec($ch);
// Close the curl session
curl_close($ch);
// Return the output as a variable
return $output;
}
$fb_user = json_decode(curl_get_contents("https://graph.facebook.com/DDDxxxIDxxxDDD/picture?type=square"),TRUE);
var_dump($fb_user);
Fatal error: Call to undefined function curl_get_content() in /home/mothz/domains/moip.tk/public_html/mo.php on line 19
Code (PHP)
<?php
function curl_get_contents($url) { // from http://www.fusionswift.com/2010/02/curl-vs-file_get_contents/
// Initiate the curl session
$ch = curl_init();
// Set the URL
curl_setopt($ch, CURLOPT_URL, $url);
// Removes the headers from the output
curl_setopt($ch, CURLOPT_HEADER, 0);
// Return the output instead of displaying it directly
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Execute the curl session
$output = curl_exec($ch);
// Close the curl session
curl_close($ch);
// Return the output as a variable
return $output;
}
$fb_user = json_decode(curl_get_content("https://graph.facebook.com/mothzip/picture?type=square"),TRUE);
var_dump($fb_user);
?>