개요
- PHP 함수 curl_get_contents()
function curl_get_contents($url) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($ch);
echo curl_error($ch);
curl_close($ch);
return $data;
}
echo curl_get_contents('https://raw.githubusercontent.com/jmnote/Miscellaneous/master/greet-utf8.txt');
# Hello 안녕
# World 세상