Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function urlExists($url=NULL)
- {
- if($url == NULL) return false;
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_TIMEOUT, 5);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $data = curl_exec($ch);
- $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
- curl_close($ch);
- return $httpcode;
- }
- echo urlExists("https://cert.vatsim.net/vatsimnet/idstatus.php?cid=1346088");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement