Home > php教程 > php手册 > 整个文件内容读进一个变量

整个文件内容读进一个变量

WBOY
Release: 2016-06-21 09:06:09
Original
948 people have browsed it

变量

php4.3.0以前
$fp = fopen("文件名","r");
$buf = fread($fp,filesize("文件名"));
fclose($fp);

php4.3.0以后还可以
$buf = file_get_contents("文件名");




Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template