Summarize some PHP information functions for you_PHP tutorial
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 ( "REMOTE_ADDR");
- echo "The client's IP is: ".$IP; ?>
- □ Execution results: This result varies from user to user. □ Reference command: None
- PHP information function get_current_user□ Applicable versions: PHP3, PHP4□ Function: Get this PHP program code Owner's name. □ Function syntax: string get_current_user (void)□ Function description: Get the name of the owner of the PHP program code currently in use. □ Sample program:
<
?PHP
- ?>
- □ Execution results: This result varies from user to user. □ Reference command: None
- PHP information function getlastmod □ Applicable versions: PHP3, PHP4□ Function: Get the last update of this web page time. □ Function syntax: int getlastmod (void)□ Function description: Get the time when the web page content was last updated on the web page currently in use. □ Sample program:
□ Execution result: Web page last updated: January 31 2001 19:51:30□ 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:□ Execution results: Different results will appear depending on the user's situation<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>
Copy after login□ Reference command: None
PHP information function phpinfo
□ Applicable versions: PHP3, PHP4□ Function: display all relevant information in the PHP system
INFO_CREDITS
□ 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_GENERALINFO_CONFIGURATION<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>
Copy after loginINFO_MODULES
INFO_VARIABLES
INFO_ENVIRONMENTINFO_LICENSEINFO_ALL□ Sample program:
System Windows 95/98 4.10 Build Date Oct 12 2000 Server API CGI Virtual Directory Support
□ Execution result:
PHP Version 4.0.3enabled 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□ Applicable versions: PHP3, PHP4<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>
Copy after login□ 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.
□ Reference command: phpinfo()
□ Sample program:
□ Execution result: PHP software version: 4.0.3PHP 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.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

In this chapter, we are going to learn the following topics related to routing ?

Working with database in CakePHP is very easy. We will understand the CRUD (Create, Read, Update, Delete) operations in this chapter.

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Validator can be created by adding the following two lines in the controller.
