Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. <?php
  2. function urlExists($url=NULL)  
  3. {  
  4.     if($url == NULL) return false;  
  5.     $ch = curl_init($url);  
  6.     curl_setopt($ch, CURLOPT_TIMEOUT, 5);  
  7.     curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);  
  8.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);  
  9.     $data = curl_exec($ch);  
  10.     $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);  
  11.     curl_close($ch);  
  12.     return $httpcode;
  13. }
  14. echo urlExists("https://cert.vatsim.net/vatsimnet/idstatus.php?cid=1346088");
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement