define means "define" and is a built-in function in PHP. Its function is to define a constant. The syntax is "define(constant name, value, $case_insensitive)"; the parameter "$case_insensitive" specifies the constant. Whether the name is size-sensitive, if true, it will not be distinguished.
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
define is a built-in function in PHP used to define a constant.
The so-called constant is a quantity that cannot be changed. Once a constant in PHP is defined, it cannot be modified or undefined.
Legal constant names can only start with letters and underscores, and can be followed by letters, numbers, or underscores of any length. In PHP, you can define a constant through the define() function. The syntax of the define() function is as follows:
define($name,$value , $case_insensitive)
Parameters | Description |
---|---|
$name | Required. Specifies the name of the constant. |
$value | Required. Specifies the value of the constant. |
$case_insensitive |
Optional. Specifies whether constant names are case-sensitive. If set to true, it will not be case sensitive. Default is false (case sensitive). |
Example:
Define a case-sensitive constant:
<?php header("Content-type:text/html;charset=utf-8"); define("WebSite","PHP中文网"); echo constant("WebSite"); ?>
Output result:
Define a case-insensitive constant:
<?php header("Content-type:text/html;charset=utf-8"); define("WebSite","PHP中文网",TRUE); echo constant("website"); ?>
Output result:
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What does define in php mean?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.
