for($i = 0; $i<20; $i++) { if($items[$i] == "the_item") echo "The item!"; else echo "Not found item in $i"; }