PHP restore_exception_handler() 函数PHP Error 和 Logging 函数Example恢复异常处理程序:<?php// 两个用户定义的异常处理函数 function myException1($exception) { e
PHP restore_error_handler() 函数PHP Error 和 Logging 函数Example在通过 set_error_handler() 函数更改错误处理函数之后对其进行恢复:<?php // 用户定义的错误处理函数 f
PHP error_reporting() 函数PHP Error 和 Logging 函数实例规定不同的错误级别报告:<?php // 关闭错误报告 error_reporting(0); // 报告 runtime 错误 error_reporting(E_ER
PHP error_log() 函数PHP Error 和 Logging 函数实例把错误消息发送到 web 服务器日志和邮件账号:<?php// 如果错误连接至数据库,则向服务器日志发送错误消息if (!mysqli_conn
PHP error_get_last() 函数PHP Error 和 Logging 函数Example返回最后发生的错误:<?php echo $test; print_r(error_get_last()); ?> 以上代码的输出类似这样:Array ( [ty
PHP debug_print_backtrace() 函数PHP Error 和 Logging 函数Example打印一条 PHP 回溯:<?php function a($txt) { b("Glenn"); } function b($txt) { c("Cleveland"
PHP debug_backtrace() 函数PHP Error 和 Logging 函数实例生成 PHP backtrace:<?php function a($txt) { b("Glenn"); } function b($txt) { c("Cleveland");} func
PHP scandir() 函数PHP Directory 函数实例列出 images 目录中的文件和目录:<?php$dir = "/images/";// 以升序排序 - 默认$a = scandir($dir);// 以降序排序$b = scandir($d
PHP rewinddir() 函数PHP Directory 函数实例打开一个目录,列出其中的文件,重置目录句柄,再次列出其中的文件,然后关闭:<?php$dir = "/images/";// 打开目录,然后读取其内容if (is
PHP readdir() 函数PHP Directory 函数实例打开一个目录,读取它的内容,然后关闭:<?php$dir = "/images/";// 打开目录,然后读取其内容if (is_dir($dir)){ if ($dh = opendir($d
PHP opendir() 函数PHP Directory 函数实例打开一个目录,读取它的内容,然后关闭:<?php$dir = "/images/";// 打开目录,然后读取其内容if (is_dir($dir)){ if ($dh = opendir($d
PHP getcwd() 函数PHP Directory 函数实例获取当前工作目录:<?phpecho getcwd()?>结果:/home/php定义和用法getchwd() 函数返回当前工作目录。语法getcwd();技术细节 返
PHP dir() 函数PHP Directory 函数实例使用 dir() 函数:<?php$d = dir(getcwd());echo "Handle: " . $d->handle . "<br>";echo "Path: " . $d->path . "<br>";while (($file
PHP closedir() 函数PHP Directory 函数实例打开一个目录,读取它的内容,然后关闭:<?php$dir = "/images/";// 打开一个目录,然后读取其内容:if (is_dir($dir)){ if ($dh = opend
PHP chroot() 函数PHP Directory 函数实例改变根目录:<?php// 改变根目录chroot("/path/to/chroot/");// 获得当前目录echo getcwd();?>Result:/定义和用法chroot() 函数改变