On JS for this there is a function some() , is there an analogue of such a function in PHP?
I did not find this in the list of functions for working with arrays.
I need to check if there is at least one element in the array that is not an empty string. I tried in_array(!'', $arr) , but this function in_array(!'', $arr) not work correctly if the array element is '0' . Another idea is to do this: implode($arr) != '' , But in my opinion this is not the best solution.
function some($array, $function) { return count(array_filter($array,$function)) != 0; }function some($array, $function) { return count(array_filter($array,$function)) != 0; }- splash58