Home > Backend Development > PHP Tutorial > file_get_contents函数可否不报错

file_get_contents函数可否不报错

WBOY
Release: 2016-06-13 12:29:52
Original
779 people have browsed it

file_get_contents函数能否不报错

本帖最后由 u013541063 于 2014-01-24 12:17:28 编辑
<br />
$lyfile = 'E:\key\Logs\lykey.Txt';<br />
$bbb = file_get_contents($lyfile);
Copy after login



当没有lykey.Txt这个文件时php就报错,能否不报错就当$bbb = '';(等于空呢)


麻烦知道的大大直接给完整代码,谢谢了
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template