How I can return boolean type in variable? I have code:
$imageRes = array_reduce(['image', 'image1', 'image2'], function ($carry) {
return in_array($carry, ['image1', 'image2']);
});
I need return
in imageRes
a boolean type: true/false, if one of the elements in ['image1', 'image2']
is in ['image', 'image1', 'image2']
. How I can do it?