php curl 基本用法

  

<?php

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.baidu.com");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
$echo = json_encode($response);
print_r($echo);
curl_close($ch);

posted @ 2014-08-25 10:16  Kyee  阅读(128)  评论(0编辑  收藏  举报