我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

PHP定义常量声明

I do not understand how this code work. displaying code below , in this code i defined a constant and the value is 10 but it display the output "constant is not defined".

why?

define('HELLO', 10);        
if(defined(HELLO))        
{        
    echo "Constant is defined";        
}        
else        
{        
    echo "Constant is not defined";        
}        

?>

change:

defined(HELLO)

to:

defined('HELLO')

http://php.net/manual/en/function.defined.php

近期文章

  • 从两个数组中获取共同的值
  • 如何获取数据属性值?
  • 客户端到php的客户端套接字
  • 注意:第5行的未定义索引
  • PHP字符串长度没有strlen()
  • php邮件没有发送到电子邮件
  • 一个类中的闭包数组
  • mysql行由where子句计数
  • PHP5.3.0的Pear错误消息
  • 解码php中的ascii字符
  • 在两个标记之间插入字符串
  • 很好地缓存了很多变量?
  • PayPal Rest API版本问题
  • 一列MySQL结果到数组
  • 从config.php访问变量[关闭]
  • 在PHP中获取更长的时区名称
  • 找不到类Firebase \ JWT \ JWT
  • 使用存储过程插入
  • 为什么Job类是随机缓存的?
  • Jquery POST没有填充数组

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华