<?php $match_counter =0; $array = array('Free Breakfast','Free Wireless Internet','Free Festival Breakfast'); $search = 'Breakfast'; foreach($array as $arr){ if(stripos($arr,$search) !==false){ echo $arr.PHP_EOL; $match_counter++; } } if($match_counter ==0){ echo 'No '.$search; }
You have javascript disabled. You will not be able to edit any code.