代码如下:
<?php
$file = 'http://www.codejia.net';
echo file_get_contents($file);
?>
file_get_contents -- 将整个文件读入一个字符串
说明
string file_get_contents ( string filename [, int use_include_path [, resource context]])
和 file() 一样,
只除了 file_get_contents() 将文件返回为一个字符串.
file_get_contents() 函数是用来将文件的内容读入到一个字符串中的首选方法.如果操作系
统支持还会使用内存映射技术来增强性能.