search
HomeBackend DevelopmentPHP ProblemWhat does define in php mean?

What does define in php mean?

Oct 13, 2021 pm 06:00 PM
definephp

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.

What does define in php mean?

The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

What does define in php mean?

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:

What does define in php mean?

Define a case-insensitive constant:

<?php
header("Content-type:text/html;charset=utf-8");
define("WebSite","PHP中文网",TRUE);
echo constant("website");
?>

Output result:

What does define in php mean?

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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Safe Exam Browser

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

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.