Php (6) PHP constants

Source: Internet
Author: User
Php (6) PHP constants 1. Custom constants

* Must be defined using the define () function

* After definition, the value cannot be changed.

* The constant name is used directly. you cannot add $ s in front of a variable.

For example: define ("PI", 3.14); defines a constant

$ Area = PI * R; calculate the area of the circle

Define ("URL", "http://www.youbml.com ");

Echo "My website is:". URL;

2 System constants:

FILE: php program FILE name

LINE: Number of PHP program files

PHP_VERSION: version number of the current parser

PHP_ OS: name of the operating system for executing the current PHP version

_ FILE _ the script FILE name being processed.

_ LINE _ current number of rows of the script file being processed, same as the previous number.

TRUE indicates the true value (TRUE ).

FALSE indicates a pseudo value (false ).

The constant E_ERROR indicates the most recent error.

E_WARNING refers to the nearest warning.

E_PARSE this constant is a potential problem with the parsing syntax.

The above is the content of the php (6) PHP constant. For more information, see The PHP Chinese website (www.php1.cn )!

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.