<?php
// $fp=fopen("a.txt","r");
// echo "ok";
if(!file_exists("a.txt"))
{
exit();//退出
} //使用die处理异常
if(!file_exists("a.txt"))
{
die("文件不存在");//打印提示再退出,不会再继续执行
// exit();
}else
{ } //用法2
file_exists("a.txt") or die("文件不存在"); ?>
2023-04-28编程教程下载本文exception,PHP,学习笔记
<?php
// $fp=fopen("a.txt","r");
// echo "ok";
if(!file_exists("a.txt"))
{
exit();//退出
} //使用die处理异常
if(!file_exists("a.txt"))
{
die("文件不存在");//打印提示再退出,不会再继续执行
// exit();
}else
{ } //用法2
file_exists("a.txt") or die("文件不存在"); ?>
《PHP学习笔记三十二【Exception】.doc》
下载本文的Word格式文档,以方便收藏与打印。