I wrote the following to see if a submitted URL has a valid http response code and also if it responds quickly. Use the code like this: <?php $is_ok = http_response($url); // returns true only if http response code < 400 ?> The second argument is optional, and it allows you to check for a specific response code <?php http_response($url,'400'); // returns true if http status is 400 ?> The third all