Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the PHP information functions?

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you "what are the PHP information functions", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what are the PHP information functions" this article.

Getenv of PHP information function

Applicable version of □: PHP3, PHP4

□ function: get the value of the environment variable.

□ function syntax: string getenv (string varname)

□ function description: this function can return the value of the environment variable of PHP, you can use this function to get the relevant data.

□ sample program:

□ execution result: this result varies from user to user.

□ reference command: none

Get_current_user of PHP information function

Applicable version of □: PHP3, PHP4

□ function function: gets the name of the owner of the PHP program code.

□ function syntax: string get_current_user (void)

□ function description: gets the name of the owner of the PHP program code currently in use.

□ sample program:

□ execution result: this result varies from user to user.

□ reference command: none

Getlastmod of PHP information function

Applicable version of □: PHP3, PHP4

□ function: get the update time of this web page.

□ function syntax: int getlastmod (void)

□ function description: get the time when the content of a web page in use is updated at once.

□ sample program:

< ?PHP echo "网页***更新时间:".date ("F d Y H:i:s,getlastmod()); ?>

□ implementation result: Web page * updated: January 31 2001 19:51:30

□ reference command: none

Getrusage of PHP information function

Applicable version of □: PHP3, PHP4

□ function: get the usage of system resources.

□ function syntax: array getrusage (int [who])

□ function description: get the current usage of system resources and return in the form of an array. For related parameters, please refer to the operation manual getrusage (2) of the system.

□ sample program:

< ?php $dat=getrusage(); echo $dat["ru_nswap"];#number of swaps echo $dag["ru_majflt"]; #number of page faults echo $dat["ru_utime.tv_sec"];#user time used (seconds) echo $dat["ru_utime.tv_usec"]; #user time used (microseconds) ?>

□ execution result: different results appear according to the status of the user

□ reference command: none

Phpinfo of PHP information function

Applicable version of □: PHP3, PHP4

□ function: displays all relevant information in the PHP system

□ function syntax: int phpinfo ([int what])

□ function description: displays a lot of information about the current PHP status, including PHP options, extension features, version, server information, module environment, environment parameters, operating system version, path … Waiting for information. The output can be changed by specifying one or more of the following settings. If you do not fill in the parameters at all, all the information will be displayed.

INFO_GENERAL

INFO_CREDITS

INFO_CONFIGURATION

INFO_MODULES

INFO_ENVIRONMENT

INFO_VARIABLES

INFO_LICENSE

INFO_ALL

□ sample program:

< ?php echo phpinfo(INFO_GENERAL); ?>

□ execution result:

PHP Version 4.0.3

System Windows 95/98 4.10 Build Date Oct 12 2000 Server API CGI Virtual Directory Support

Enabled Configuration File (php.ini) Path php.ini ZEND_DEBUG disabled Thread Safety Enabled

This program makes use of the Zend scripting language engine: Zend Engine v1.0.3, copyright (c)

1998-2000 zend Technologies

□ reference command: phpversion ()

Phpversion of PHP information function

Applicable version of □: PHP3, PHP4

□ function: get the version information of the PHP system.

□ function syntax: string phpversion (void)

□ function description: returns the executing version of the PHP interpreter as a string.

□ sample program:

< ?php echo "PHP" 软件版本: ".phpversion(); ?>

□ execution result: PHP software version: 4.0.3

□ reference command: phpinfo ()

Set_time_limit of PHP information function

Applicable version of □: PHP > = 4.0.4, PHP4

□ function: limit the maximum execution time.

□ function syntax: void set_time_limit (int seconds)

□ function description: limit the number of seconds this PHP program can execute, if the program execution time to the set number of seconds, will generate a fatal error error message, and interrupt the execution of the program.

The internal time limit is 30 seconds, and the method of time calculation is: program? The calculation starts when it is read and executed, so if the setting time is 20 seconds, but it takes 25 seconds to load and execute, it must take a total of 45 seconds for the web page to be interrupted. If the time is set to 0, there is no time limit.

The above is all the contents of the article "what are the PHP information functions?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report