Posted By

createinside on 04/23/10


Tagged

php header ping status


Versions (?)

PHP Ping link and return header status


 / Published in: PHP
 

  1. function get_link_status($link)
  2. {
  3. $ch = curl_init($link);
  4. curl_setopt($ch, CURLOPT_NOBODY, 1);
  5. $c = curl_exec($ch);
  6. return (int)curl_getinfo($ch, CURLINFO_HTTP_CODE);
  7. }

Report this snippet  

You need to login to post a comment.