Re: What variable are being sent to my script?
| From: | Plutarck | Date: | Fri, 13 Apr 2001 02:45:14 +0000 |
| Subject: | Re: What variable are being sent to my script? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-48397@lists.php.net to get a copy of this message | ||
Even better, there is a whole PHP function just for that.
I use the following code in scripts where I need to debug the available
variables and their values:
// Print all available variables.
$arr = get_defined_vars();
print_r($arr);
I love print_r ;)
--
Plutarck
Should be working on something...
...but forgot what it was.
""Ashley M. Kirchner"" <ashley@pcraft.com> wrote in message
news:3AD639F2.EBBF591D@pcraft.com...
> Brandon Orther wrote:
>
> > I there a way for me to find out what variables are being sent to
script?
> > Example:
> >
> > http://www.myscript.com/myscript.php?var1=asdf&var2=asdf
> >
> > that above would be $var1 and $var2
>
> Stick <? phpinfo() ?> at the end of your script, and go through it so
you
> can see all the nifty variables that PHP sets for you when you pass
arguments
> to it. Good way to learn too.
>
> AMK4
>
> --
> W |
> | I haven't lost my mind; it's backed up on tape somewhere.
> |____________________________________________________________________
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Ashley M. Kirchner <mailto:ashley@pcraft.com> .
> 303.442.6410 x130
> SysAdmin / Websmith . 800.441.3873 x130
> Photo Craft Laboratories, Inc. . eFax 248.671.0909
> http://www.pcraft.com . 3550
> Arapahoe Ave #6
> .................. . . . . Boulder, CO 80303, USA
>
>