php 请求url并且获取返回值

$opts = array('http'=>array('header' => "User-Agent:MyAgent/1.0\r\n"));
$context = stream_context_create($opts);
print(file_get_contents('url地址', false,$context));

 

你可能感兴趣的:(PHP,php)