Advertisement
shor7cut

PHP get HTTP_CODE

Dec 8th, 2015
433
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. // Create a curl handle
  3. $ch = curl_init('http://www.yahoo.com/');
  4.      curl_setopt($ch, CURLOPT_NOBODY  , true);
  5.      curl_exec($ch);
  6.      $info = curl_getinfo($ch);
  7.      echo $info['http_code'];
  8. ?>
Advertisement
RAW Paste Data Copied
Advertisement