I'm having trouble with output in for each function in PHP (actually don't know how to set the code to do what I need). I'd like to output some text if every item in foreach is equal to some value. If I put
foreach($items as $item) {
if($item == 0){ echo "true"; }
}
I will get true for every item and I need to output true only if all items are equal to some value.
Thanks!
if (count(array_unique($items)) === 1) { ... }.