How to use define to define constants in PHP
This article mainly introduces the relevant knowledge of "how to use define to define constants in PHP". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to use define to define constants in PHP" can help you solve the problem.
Description
1. The variable in PHP refers to the amount by which the value used in the program can be changed. On the contrary, it is constant.
2. After the constant value is defined, nothing else in the script can be changed.
Format
Define (string $name, mixed $value, bool $case_insensitive = false)
$name: general name.
$value: constant value; in PHP5, value must be a standard value (int, float, string, boolean, null) or an array value in PHP7.
$case_insensitive: if set to true, it is case insensitive. By default, case is sensitive. PHP7.3.0 discards constants that define case-insensitivity.
Return value: true is returned on success and false on failure.
Example
Allowed to be array
Define ('People', array (' man', 'woman',' strick')); echo People [1];? > 1 output: woman on "how to use define to define constants in PHP" is introduced here, thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.