Miscellaneous Functions Library: Define

Source: Internet
Author: User
Keywords define php Chinese function manual miscellaneous function library
Tags aliyun function function library functions html http name php

Define

(PHP3, PHP4)

Define---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Define a constant name

Syntax: int define (string name, mixed value [, int case_insensitive])

Description:

Define a constant name, similar to a variable, in different places:

The symbol in front of the constant without money ($)
Constants can be accessed anywhere, without regard to variable scope rules
Once the constants are set, they don't need to be defined.
Constants can only be a number of values
The parameter name is the name of the constant, and value is the constant.

If you set the third argument case_insensitive to 1, the constants will be defined as case-insensitive. The presets are case-sensitive, for example: constant and constant represent different values.

Example:

<?php

Define ("CONSTANT", "Hello world.");

Echo CONSTANT; Outputs "Hello world."

?>

Returns true if define () succeeds, and returns False if an error occurs.

Reference: Tabbed ()

Related Article

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.