For you to summarize some PHP information functions, summarize PHP information function _php Tutorial

Source: Internet
Author: User
Tags php software

For you to summarize some PHP information functions, summarize the PHP information function


Some of the function concepts included in the PHP information function are summarized below.

The getenv of PHP information function

Applicable version: PHP3, PHP4
function function: Gets the value of the environment variable.
function Syntax: string getenv (String varname)
Function Description: This function can return the value of the environment variables of PHP, and use this function to obtain the relevant data.
Example program:

<? PHP $ip =getenv ("remote_addr"); echo "Client IP is:". $IP;?>

Execution Result: This result is different for different users.

The Get_current_user of PHP information function

Applicable version: PHP3, PHP4
function function: Get the name of the owner of the PHP program code.
function Syntax: string get_current_user (void)
Function Description: Get the name of the owner of the PHP program code currently in use.
Example program:

<? PHP echo Get_current_user ();?>

Execution Result: This result is different for different users.

The Getlastmod of PHP information function

Applicable version: PHP3, PHP4
Function: Gets the last time this page was updated.
function syntax: int getlastmod (void)
Function Description: Gets the time when the page content was last updated in the current use.
Example program:

Execution Result: webpage Last updated: January 31 2015 19:51:30

The Getrusage of PHP information function

Applicable version: PHP3, PHP4
function function: Get system Resource usage status.
function syntax: array getrusage (int [who])
Function Description: Obtain the current system resource usage, return as an array, related parameters refer to the operating manual of the system Getrusage (2).
Example program:

execution Result: different results depending on the user's condition

The Phpinfo of PHP information function

Applicable version: PHP3, PHP4
function function: Displays all relevant information in the PHP system
function syntax: int phpinfo ([int what])
Function Description: Displays a large amount of information about the current state of PHP, including PHP options, extensions, version, server information, module environment, environment parameters, operating system version, path ... and other information. The results of the output can be changed by specifying one or more of the following settings. If you do not fill in the parameters completely, all the information is displayed.
Example program:

Execution Result:

PHP Version 4.0.3 System Windows 95/98 4.10 Build Date Oct-Server API CGI Virtual Directory support enabled Config Uration 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 ()

The Phpversion of PHP information function

Applicable version: PHP3, PHP4 function: Gets the version information of the PHP system.
function Syntax: string phpversion (void)
Function Description: Returns the PHP interpreter version that is being executed as a string type.
Example program:

Execution Result: PHP software version: 4.0.3 reference command: Phpinfo ()

The Set_time_limit of PHP information function

Applicable version: php>=4.0.4, PHP4
function 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 executes the time to set the number of seconds, will generate an error message fatal error, and interrupt the execution of the program.

The default time limit is 30 seconds, and the execution time calculation is done when the program is read and executed, so if the set time is 20 seconds, but it takes 25 seconds to load and execute, it will take 45 seconds for the page to be executed. If the time is set to 0, no time limit is expressed.

The above is a small compilation of all the PHP time function, I hope that everyone's learning has helped.

http://www.bkjia.com/PHPjc/1063221.html www.bkjia.com true http://www.bkjia.com/PHPjc/1063221.html techarticle for you to summarize some PHP information functions, summarize the PHP information function PHP information function contains some of the functions of the concept summarized below. PHP Information function getenv applicable version: PHP3, PHP4 function function: ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.