PHP看看数组包含超过0值? [英] php find out if array contains values of over 0?
本文介绍了PHP看看数组包含超过0值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果没有通过阵列中的每个值循环,有没有什么快捷方式检查是否包含在0值?
例如:
阵列(3,0,0)
将是真实的。
阵列(0,0,0)
将FALSE
阵列(-2,0,-3)
将FALSE
解决方案
IF(MAX(阵列(3,0,0))0)回声大于0;
Without looping through each value in an array, is there any shortcut to checking whether it contains values over 0?
Eg
array(3,0,0)
would be TRUE
array(0,0,0)
would be FALSE
array(-2,0,-3)
would be FALSE
解决方案
if (max(array(3,0,0)) > 0) echo 'greater than 0';
这篇关于PHP看看数组包含超过0值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文