Home  >  Article  >  Backend Development  >  PHP 恒量

PHP 恒量

WBOY
WBOYOriginal
2016-06-13 12:07:32799browse

PHP 常量

设置 PHP 常量如需设置常量,请使用 define() 函数 - 它使用三个参数:首个参数定义常量的名称第二个参数定义常量的值可选的第三个参数规定常量名是否对大小写敏感。默认是 false。下例创建了一个对大小写敏感的常量,值为 "Welcome to W3School.com.cn!":实例<?phpdefine("GREETING", "Welcome to W3School.com.cn!");echo GREETING;?>运行实例下例创建了一个对大小写不敏感的常量,值为 "Welcome to W3School.com.cn!":实例<?phpdefine("GREETING", "Welcome to W3School.com.cn!", true);echo greeting;?>

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