php find out if array contains values of over 0?

后端 未结 1 1330
长情又很酷
长情又很酷 2020-12-21 17:00

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 TR

1条回答
  •  萌比男神i
    2020-12-21 17:22

    if (max(array(3,0,0)) > 0) echo 'greater than 0';
    

    0 讨论(0)
提交回复
热议问题