Is there a function which I could give an array, which would return true if the provided function returned true for all of them?
theFunction(array(1,2,3) , 'is_numeric') //true
theFunction(array(1,"b",3) , 'is_numeric') //false
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, but you can use
array_reduce:You can of course build your own higher-order function: