Home  >  Article  >  Backend Development  >  What are the most commonly used system constants in php?

What are the most commonly used system constants in php?

怪我咯
怪我咯Original
2017-06-20 10:29:044915browse

This article collects some of the most commonly used system constants in PHP for your reference.

System constants

  • FILE The relative path of the current PHP file

  • LINE The current PHP file The line number

  • FUNCTION the current function name, only works for calls within the function

  • CLASS the current class name , only works for classes

  • PHP_VERSION The currently used PHP version number

  • PHP_OS The running operating system of the current PHP environment

  • TRUE Same as true

  • FALSE Same as false

  • M_PI Pi constant value

  • M_E The scientific constant e

  • M_LOG2E represents log2

  • ##e, the logarithm of e with base 2

  • M_LOG10E represents lg

  • e, the logarithm of e with base 10

  • M_LN2 The natural logarithm of 2

  • M_LN10 Natural logarithm of 10

  • E_ERROR Recent errors

  • E_WARNING Recent Warnings

  • Potential problems with E_PARSE parsing syntax

  • METHOD represents the class method name, such as B::test

Server global Variables

  • $_SERVER Returns server related information, returns An

    array

  • $_GET All the parameters from the GET request

  • $_POST All the parameters from the POST

  • $_

    COOKIE All cookies submitted by HTTP

  • $_FILES All files submitted by HTTP

  • $_ENV Current execution environment information

  • $_REQUEST is equivalent to the data submitted by $_POST, $_GET, $_COOKIE, so this variable is not worthy of trust

  • $_

    SESSION session session variable


The above is the detailed content of What are the most commonly used system constants in php?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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