<?php //1.php中的错误的处理,die函数的使用 /*if(!file_exists("aaa.txt")){ die("文件不存在,程序并且退出,hello不打印!"); }else{ echo "打印文件"; } echo "hello";*/ //2.如果文件存在,就会向下执行,如果i文件不存在,执行die方法 file_exists("aaa.txt") or die("文件不存在"); echo "ok"; ?>
<?php //1.php中的错误的处理,die函数的使用 /*if(!file_exists("aaa.txt")){ die("文件不存在,程序并且退出,hello不打印!"); }else{ echo "打印文件"; } echo "hello";*/ //2.如果文件存在,就会向下执行,如果i文件不存在,执行die方法 file_exists("aaa.txt") or die("文件不存在"); echo "ok"; ?>