[Study Notes] the platform for Video audio/video database of accident cases .. Learning

Source: Internet
Author: User
The define () function defines a constant.

Constants are similar to variables, except that:

    • After setting, the constant value cannot be changed.
    • The constant name does not need to start with the dollar sign ($)
    • The scope does not affect constant access.
    • A constant value can only be a string or number.

Syntax:

Define (name, value, case_insensitive)

Name: constant name;

Value: constant value;

Case_insensitive: default value:False, IndicatesCase Sensitive, True indicates not case sensitive;

 

Use the constant () function with the define () function:

Returns the constant value.

Explanation: this function is only applicable to Class constants.

 

Explanation:Scope refers to the availability range that limits a name.

Let's look for an example to practice:

Example:

<? Php <br/> define ("demo01", "Hello world! ", False); <br/> echo constant (" demo01 "); <br/>?>

Webpage output:

Warning: constant () [function. Constant]: Couldn't find constant demo01 in D: \ Wamp \ www \ com \ shyy \ newfile. php on line 3 <br/>

At this point, the editor will catch your error...

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.