PHP中的惊叹号是什么意思? [英] What does the exclamation point mean in PHP?

查看:139
本文介绍了PHP中的惊叹号是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

参考 - 这个符号在PHP中意味着什么?

混淆空,isset,!空,!isset

在PHP中有什么区别:

In PHP what is the difference between:

if(!isset) 
if(isset)

相同if(!empty) if(空)

!是什么字符是什么意思?

What does the "!" character mean?

推荐答案

是逻辑否定或运营商。它颠倒了逻辑测试的意义。

! is the logical negation or NOT operator. It reverses the sense of the logical test.

即:


  • if(isset)如果 isset 是逻辑 True

  • if(!isset)如果 isset 合乎逻辑 错误

  • if(isset) makes something happen if isset is logical True.
  • if(!isset) makes something happen if isset is logical False.

有关运营商的更多信息(逻辑和 PHP文档。)查找在那里巩固你对它的作用的理解。当你在那里时,也要查找其他逻辑运算符:

More about operators (logical and other types) in the PHP documentation. Look up ! there to cement your understanding of what it does. While you're there, also look up the other logical operators:


  • && 逻辑AND

  • || 逻辑或

  • xor 逻辑EXCLUSIVE-OR

  • && logical AND
  • || logical OR
  • xor logical EXCLUSIVE-OR

逻辑语句中也常用。

这篇关于PHP中的惊叹号是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆