To-Slalom

GetHeaders

May 19th, 2017
78
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /* get headers */
  3. $URL= 'http://i1.ytimg.com/vi/3hc_dkWO82E/'.'mqdefault.jpg' ;
  4. echo get_http_response_code ( $URL ) ; then i get final code 404, 301,...
  5.     function get_http_response_code ( $URL ) {
  6.         $headers = get_headers ( $URL ) ;
  7.         return substr ( $headers[0] , 9 , 3 ) ;
  8.     }
  9. ?>
RAW Paste Data