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