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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-21 09:06:09967browse

变量

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

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




Statement:
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