php ch curl_init curl_setopt ch CURLOPT_URL http php net curl_setopt c

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://php.net");
//curl_setopt($ch, CURLOPT_URL, "http://vkontakte.ru");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_NOBODY, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
echo curl_exec($ch);
curl_close($ch);
?>