while () { $url = $_; $response = somefunc(); next if $response==500; unless($response == 200) { } }