Re: $GLOBALS
| From: | Emil Rasmussen | Date: | Tue, 13 Nov 2001 14:26:56 +0000 |
| Subject: | Re: $GLOBALS | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-74434@lists.php.net to get a copy of this message | ||
> i´m new in PHP. What does the expression:
> $ref=$GLOBALS["HTTP_GET_VARS"]["ref"];
> $id=$GLOBALS["HTTP_GET_VARS"]["id"];
> do?
It gives you the content of the querystring variable ref and id. eg.
page.php?id=20&ref=value
> What is $GLOBALS?
$GLOBALS is an array wich contains all the varibles in the "global variable
scope". http://dk.php.net/manual/en/language.variables.scope.php
You can get an overview of all the variables by using the print_r()
function: print_r($GLOBALS);
http://dk.php.net/manual/en/function.print-r.php
> What are the parameters ["HTTP_GET_VARS"]["ref"]?
["HTTP_GET_VARS"] is also an array, and it contains alle the variables from
the querystring. And ['ref'] is a querystring variable.
/Emil
--
Emil Rasmussen
http://noget.net