PHP error_get_last() 函数

PHP 教程 · 2019-01-24 14:43:20

定义和用法

error_get_last() 函数获得最后发生的错误。

该函数以数组的形式返回最后发生的错误。如果没有错误发生则返回 NULL。

返回的错误数组包含 4 个键名和键值:

  • [type] - 错误类型
  • [message] - 错误消息
  • [file] - 发生错误所在的文件
  • [line] - 发生错误所在的行

语法


error_get_last()


实例


<?php
echo $test;
print_r(error_get_last());
?>

上面代码的输出如下所示:


Array
(
[type] => 8
[message] => Undefined variable: test
[file] => C:webfoldertest.php
[line] => 2
)


点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Learning Web Design

Learning Web Design

Jennifer Niederst Robbins / O'Reilly Media / 2007-6-15 / USD 44.99

Since the last edition of this book appeared three years ago, there has been a major climate change with regard to web standards. Designers are no longer using (X)HTML as a design tool, but as a means......一起来看看 《Learning Web Design》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具