本文介绍了PHP if($ some_var == 1)总是返回true,即使它不是true吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这个问题很简单,但我不知道什么是最好的解决方法。
This issue is simple, but I am not sure what is the best approach to get around it.
如果变量包含一个数字,如果确实 $ some_var
是一个
If the variable contains a number, how can I make sure that the if statement only returns true if indeed the $some_var
is one?
推荐答案
您需要使用3个等于
if($some_var ===1){
这里是更多信息
这篇关于PHP if($ some_var == 1)总是返回true,即使它不是true吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!