<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> get_contents.php </title>
<meta charset="UTF-8">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head> <body>
<hr>
<?php
$url='http://localhost/myphp/StrPrice.html';
$contents=file_get_contents($url) or die('file_get_contents failed!');
var_dump($contents); $stream=fopen($url,'rb');
$contents=stream_get_contents($stream) or die('stream_get_contents failed!');
var_dump($contents);
fclose($stream);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL,$url);
$result = curl_exec($ch);
var_dump($result);
?><br><br>
</body>
</html>
file_get_contents($url) stream_get_contents($stream)
转载
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
(转载)file_get_contents(php xml 数据
-
php file_get_contents
php file_get_contents
php file_get_contents -
file_get_contents遍历api数据
使用【bootstrap】框架关键代码:
html bootstrap postman php i++