Superglobals
So far (end of chapter 1, just before jumping into the OO part) the book doesn't say a word about superglobals. I think this is an important topic and I suppose there must be questions about the superglobals on the exam.
The best place to get an idea about the superglobals is this PHP.net manual entry.
Note how there was a different set of superglobals prior to php.4.1 but I was lead to believe that the exam is concentrated on stuff after 4.1. (and before php5).
Briefly, here's the list of superglobals:
- $_GET - variables sent using a GET HTTP request
- $_POST - variables sent using a POST HTTP request
- $_COOKIE - array of all cookies that are sent by the server
- $_REQUEST - a merge of the three above
- $_SESSION - array containing the session data
- $_SERVER - server variables like REMOTE_ADDR, SCRIPT_NAME, REQUEST_URI, etc.
- $_ENV - more or less the same as $_SERVER
- $_FILE - data about uploaded files
- $GLOBALS - array of all global variables, see the previous blog entry for an example
This entry was posted on Monday, March 28th, 2005 and is filed under PHP certification. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Get notification for future posts: follow me on Twitter or subscribe to my RSS feed

October 23rd, 2006 at 12:14 pm
Quite a late comment, but important to know:
$_FILE should be $_FILES
October 23rd, 2006 at 1:55 pm
True!
This always gets me. In any decent editor with source highlighting, I can type until the keyword is highlighted, then I know I’m right. Unforunatelly there was a similar question in the actual exam, I’m not sure I got it right. I mean c’mon, global $var, $_GLOBALS['var'], argh…