<?php
$fp = fopen('welcome.txt', 'r');
if (!$fp) {
echo 'Could not open file somefile.txt';
}
while ($char = fgetc($fp)) {
echo "$char";
}
?>
小白,我想把我的txt文件全部显示,当爱30KB左右,但是我用这段代码,百度知道找到的,不能显示完全,只能显示2-3kb左右,请问下,怎样把源文件全部显示出来嘞?
推荐使用file_get_content函数读取,再一次性echo
谢谢你,我找到了,但是这个没判断,帮我写个判断被,就是当文件不错在的时候!
-_-# lie.....那是说谎的意思,得line
你要写判断?
<?php亲,不会下,能帮我写个完整的嘛!拜托了