$fp = fopen($myFile, "r");
//if echo $fp => I GOT NULL
fclose($fp);
但是,如果我做file_get_contents($myFile);
我得到了该文件的字符串数据。
我的文件(Fedora的OS)
-rw-r--r-- 1 apache appli 104 2 nov. 12:54 12_62_xxx.log
$fp = fopen($myFile, "r");
//if echo $fp => I GOT NULL
fclose($fp);
但是,如果我做file_get_contents($myFile);
我得到了该文件的字符串数据。
我的文件(Fedora的OS)
-rw-r--r-- 1 apache appli 104 2 nov. 12:54 12_62_xxx.log
你有该文件的权限吗? – JackTurky
是因为file_get_contents($ myFile)我得到了文件内容。 – sophie
使用'var_dump'而不是'echo'来找出'$ fp'确实是什么:'var_dump($ fp)'; – hakre