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
Post a Comment