Friday, April 27, 2012

What does PHP's print_r($_SERVER) output?

<?php
print_r($_SERVER);
/*
THE ABOVE CODE OUTPUTS:
Array
(
    [HTTP_HOST] => localhost:8888
    [HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20100101 Firefox/11.0
    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;
    [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5
    [HTTP_ACCEPT_ENCODING] => gzip, deflate
    [HTTP_CONNECTION] => keep-alive
    [HTTP_REFERER] => http://localhost:8888/?m=settings!subscription!upgrade
    [HTTP_COOKIE] => __utma=111872281.1314222649.1332850396.1335657071.1335660029.147
    [PATH] => /Users/johnerck/svn/rocphp/path:/usr/bin:/bin:/usr/sbin:/sbin
    [SERVER_SIGNATURE] => 
    [SERVER_SOFTWARE] => Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/0.9.8r DAV/2 PHP/5.3.6
    [SERVER_NAME] => localhost
    [SERVER_ADDR] => ::1
    [SERVER_PORT] => 8888
    [REMOTE_ADDR] => ::1
    [DOCUMENT_ROOT] => /Users/johnerck/git/rocware.com/www
    [SERVER_ADMIN] => you@example.com
    [SCRIPT_FILENAME] => /Users/johnerck/git/rocware.com/www/index.php
    [REMOTE_PORT] => 53964
    [GATEWAY_INTERFACE] => CGI/1.1
    [SERVER_PROTOCOL] => HTTP/1.1
    [REQUEST_METHOD] => GET
    [QUERY_STRING] => m=dashboard
    [REQUEST_URI] => /?m=dashboard
    [SCRIPT_NAME] => /index.php
    [PHP_SELF] => /index.php
    [REQUEST_TIME] => 1335661670
    [argv] => Array
        (
            [0] => m=dashboard
        )

    [argc] => 1
)
*/
Looking for a cloud-based catalog and CRM platform? Checkout http://rocware.com/

4 comments:

About Me

My photo
I code. I figured I should start a blog that keeps track of the many questions and answers that are asked and answered along the way. The name of my blog is "One Q, One A". The name describes the format. When searching for an answer to a problem, I typically have to visit more than one site to get enough information to solve the issue at hand. I always end up on stackoverflow.com, quora.com, random blogs, etc before the answer is obtained. In my blog, each post will consist of one question and one answer. All the noise encountered along the way will be omitted.