PHP magic! | Rickard Andersson

PHP magic!

While working on using fopen()/file_get_contents() with allow_url_fopen enabled, I ran into something odd. When you use fopen() or file_get_contents() to fetch a page over HTTP, the variable $http_response_header magically appears in the global scope. This variable holds an array of all the HTTP headers that were included in the response. Practical, but what the hell? I smell a hack!

Post a Comment

Comments are moderated. Your email is never published nor shared.