【问题标题】:Purpose of !$ and difference b/w isset and empty? [duplicate]!$ 的目的以及 isset 和 empty 之间的区别? [复制]
【发布时间】:2017-04-11 23:02:13
【问题描述】:
  1. !$ 在 PHP 中的用途是什么?
  2. issetempty 有什么区别?

【问题讨论】:

标签: php


【解决方案1】:
  1. !$ 表示NOT 因此如果(!$a)$a == TRUE 那么它是NOT TRUE
    参考:http://www.php.net/manual/en/language.operators.logical.php

  2. ISSET 返回TRUE,如果变量存在并且值不是NULL
    EMPTY 检查变量是否为空。
    参考:http://php.net/manual/en/function.isset.php http://php.net/manual/en/function.empty.php

【讨论】:

  • 精彩回复
猜你喜欢
  • 1970-01-01
  • 2012-06-17
  • 1970-01-01
  • 2014-01-02
  • 2016-08-16
  • 2014-11-01
  • 2013-07-01
  • 1970-01-01
  • 2017-06-30
相关资源
最近更新 更多