Home > Backend Development > PHP Tutorial > php中的phpinfo()函数有什么用

php中的phpinfo()函数有什么用

PHPz
Release: 2020-09-05 11:01:51
Original
7039 people have browsed it

php中的phpinfo()函数的作用:phpinfo()函数是php中的一个内置函数,它可以提供关于系统中安装的php版本和php配置的详细信息。该函数在执行成功时返回true,执行失败时返回false。

php中的phpinfo()函数有什么用

phpinfo()函数

phpinfo()函数会输出关于 PHP 配置的信息。

phpinfo()是PHP中的一个内置函数,可以提供关于系统中安装的PHP版本和PHP配置的详细信息。phpinfo()函数返回一个布尔值;也就是说,它在成功时返回true,在faliure时返回false 。

基本语法:

phpinfo ([ int $what = INFO_ALL ] )
Copy after login

参数:

$what是一个可省略的参数,但$what被省略,则会输出全部的配置信息。

它可以有以下值:

● INFO_GENERAL:信息概述,用于显示配置行、php.ini位置、构建日期、Web服务器、系统等。

● INFO_CREDITS:用于显示PHP Credits。

● INFO_CONFIGURATION: 信息配置,用于显示PHP指令的当前值,本地值和主值。

● INFO_MODULES:信息模块,用于显示已加载的模块及其各自的设置。

● INFO_ENVIRONMENT:信息环境,用于显示环境变量信息。

● INFO_VARIABLES:信息变量,它显示来自EGPCS(环境,GET,POST,Cookie,服务器)的所有预定义变量。

● INFO_LICENSE:信息许可,用于显示PHP许可证信息。

● INFO_ALL:全部信息,显示以上所有信息。

返回类型:phpinfo()函数返回一个布尔值。也就是说,它在成功时返回true,在faliure时返回false 。

示例:

<?php 
phpinfo(); 
?>
Copy after login

输出:

1.png

会显示有关PHP版本,配置,环境详细信息等的完整信息。

注意:使用CLI模式时,phpinfo()输出纯文本而不是HTML。

更多相关知识,请访问 PHP中文网!!

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template