Advertisement
shor7cut

PHP get HTTP_CODE

Dec 8th, 2015
518
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.21 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment
Advertisement