title: PHP get http header response code without cURL
body: <p>I have written a class that detects if cURL is available, if it is performs GET, POST, DELETE using cURL.    In the cURL version I use <code>curl_getinfo($curl, CURLINFO_HTTP_CODE);</code> to get the HTTP code.  If is cURL is not available it uses fopen() to read the file contents.  How do I get the HTTP header code without cURL?</p>