PHP的file_get_contents函数用于将一个文件的内容读入一个字符串中。
语法:
string file_get_contents(string $filename [, bool $use_include_path = FALSE [, resource $context [, int $offset = -1 [, int $maxlen = -1]]]])
参数说明:
返回值:
示例:
$content = file_get_contents('test.txt');
echo $content;
$content = file_get_contents('http://example.com');
echo $content;
注意事项:
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:PHP的file_get_contents函数怎么使用