php - Check if an array has different value than zero -


I need to check whether my array has different values ​​than 0 (for this particular case). Apart from this, the array can vary from element 1 to m elements.

My array is of the form: (These are the random numbers that can change the position)

  array ('0', '1', '1', ' 3 ',' 1 ',' 5 ',' 0 '' 2 '/*...*/);  

Is such a function, or do I need to run a whole array and do a loop to check each index?

You can use the function maximum () which is the highest from the array Value

  if (maximum ($ MyArray)> 0) {#do ur talk}  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -