PHP information function getenv
□ Applicable versions: PHP3, PHP4
□ Function function: Get Environment variable value.
□ Function syntax: string getenv (string varname)
□ Function description: This function can return the value of PHP's environment variable. You can use this function to obtain relevant data.
□ Sample program:
<
?PHP
□ Reference command: None
PHP information function getrusage
□ Applicable versions: PHP3, PHP4□ Function: Get system resource usage status.
□ Function syntax: array getrusage (int [who])
□ Function description: Get the current system resource usage status and return it in the form of an array. For related parameters, please refer to the system operation manual getrusage(2).
□ Sample program:
<ol class="dp-xml"><li class="alt"><span><span class="tag"><</span><span> ?PHP </span></span></li><li><span>echo "网页最后更新时间:".date <br />("F d Y H:i:s,getlastmod()); </span></li><li class="alt"><span class="tag">?></span><span> </span></span></li></ol>
□ Reference command: None
PHP information function phpinfo
□ Applicable versions: PHP3, PHP4□ Function: display all relevant information in the PHP system
□ Function syntax: int phpinfo ([int what])
□ Function description: Display a large amount of information about the current PHP status, including PHP options, extended functions, version, server information, module environment, environment parameters, operating system version, path... and other information. The output results can be changed by specifying one or more of the following settings. If no parameters are filled in at all, all information will be displayed.
INFO_GENERAL
<ol class="dp-xml"><li class="alt"><span><span class="tag"><</span><span> ?php </span></span></li><li><span>$</span><span class="attribute">dat</span><span>=</span><span class="attribute-value">getrusage</span><span>(); </span></li><li class="alt"><span>echo $dat["ru_nswap"];#number of swaps </span></li><li><span>echo $dag["ru_majflt"]; #number of page </span></li><li class="alt"><span>faults </span></li><li><span>echo $dat["ru_utime.tv_sec"];#user time </span></li><li class="alt"><span>used (seconds) </span></li><li><span>echo $dat["ru_utime.tv_usec"]; #user time </span></li><li class="alt"><span>used (microseconds) </span></li><li><span class="tag">?></span><span> </span></span></li></ol>
INFO_MODULES
INFO_ENVIRONMENT
INFO_LICENSEINFO_ALL□ Sample program:
□ Execution result:
PHP Version 4.0.3
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( )
PHP information function phpversion
<ol class="dp-xml"><li class="alt"><span><span class="tag"><</span><span> ?php </span></span></li><li><span>echo phpinfo(INFO_GENERAL); </span></li><li class="alt"><span class="tag">?></span><span> </span></span></li></ol>
□ Function: Get the version information of the PHP system.
□ Function syntax: string phpversion (void)□ Function description: Return the executing PHP interpreter version as a string.
□ Sample program:
□ Execution result: PHP software version: 4.0.3
PHP information function set_time_limit
□ Applicable versions: 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 that this PHP program can be executed. If the execution time of the program reaches the set number of seconds, a fatal error will be generated. information, and interrupt program execution.
The default time limit is 30 seconds. The execution time calculation method is: the calculation starts when the program is read and executed. Therefore, if the set time is 20 seconds, but it takes 25 seconds to load and execute, It took a total of 45 seconds for the web page to be interrupted. If the time is set to 0, it means there is no time limit.