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

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -