Important Note to All New Users: functions do NOT have default access to GLOBAL variables. You must specify globals as such in your function using the 'global' type/keyword. See the section on variables:scope.
This note should also be added to the documentation, as it would help the majority of programmers who use languages where globals are, well, global (that is, available from anywhere). The scoping rules should also not be buried in subsection 4 of the variables section. It should be front and center because I think this is probably one of the most non-standard and thus confusing design choices of PHP.
[Ed. note: the variables $_GET, $_POST, $_REQUEST, $_SESSION, and $_FILES are superglobals, which means you don't need the global keyword to use them inside a function]