1$items = ['a' , 'b' , 'c'];
2
3foreach($items as $item)
4{
5 if($item == 'a')
6 {
7 return true; // the foreach will stop once 'a' is found and returns true.
8 }
9
10 return false; // if 'a' is not found, the foreach will return false.
11}
12