Home  >  Article  >  Backend Development  >  How to define constants in php classes

How to define constants in php classes

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-09-25 17:09:024507browse

PHP defines constants using the define() method.

Related recommendations: "php Getting Started Tutorial"

define() method has three parameters:

1. The constant name of string type needs to be used Enclosed in double quotes [required parameters].

2. The value of the defined constant [required parameter].

3. Specify whether case is sensitive, true means insensitive, false means sensitive (default is false) [optional parameter].

The above is the detailed content of How to define constants in php classes. 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