code_junkie

Equivalent is_file() function for URLs?

Nov 12th, 2011
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. <?php
  2. // create a new cURL resource
  3. $ch = curl_init();
  4.  
  5. // set URL and other appropriate options
  6. curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
  7. curl_setopt($ch, CURLOPT_HEADER, 1);
  8. curl_setopt($ch, CURLOPT_NOBODY, 1);
  9.  
  10. // grab URL and pass it to the browser
  11. curl_exec($ch);
  12.  
  13. // close cURL resource, and free up system resources
  14. curl_close($ch);
  15. ?>
Add Comment
Please, Sign In to add comment