使用@抑制住警告,可做出提示处理
$file="C:\1.txt"; @fp=fopen($file,'r'); // if the file is not exist, it won't throw an exception //handle the exception manually if(!fp){ die("file not exist!"); } else{ //do sth }
使用@抑制住警告,可做出提示处理
$file="C:\1.txt"; @fp=fopen($file,'r'); // if the file is not exist, it won't throw an exception //handle the exception manually if(!fp){ die("file not exist!"); } else{ //do sth }