for($i=0; $i<21; $i++) { $hosps = $i . " minutes left"; if(strpos($lol,$hosps)) { $hospst = $hosps; } print_r($lol); print_r($hosps); }