Re: [PHP] Re: variable container?

2004-01-26 Thread Shawn McKenzie
So why not use: get_defined_vars()?

Returns an array of all defined variables :-)

-Shawn

"Jake McHenry" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> - Original Message - 
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, January 26, 2004 6:12 PM
> Subject: Re: [PHP] Re: variable container?
>
>
> > Hello Jake,
> >
> > On 26 Jan 2004 at 17:55, Jake McHenry wrote:
> >
> > > I want a list of all variables used. I tried just putting var_dump()
but
> got
> > > an error. I'd like to see a list of all variables being used in the
> script,
> > > then I can start cleaning original code and what I have added. Some
> strange
> > > results lead me to believe I'm declaring the variables more than once
> with
> > > different values, and I'd like to know if there is a way that I can
just
> get
> > > a dump of ALL the variables in use. Unless I'm using the function
wrong.
> > > Please advise.
> >
> > I don't think you can print out *all* the variables in *all* scopes and
> their values, but you
> > can certainly get a list of all the variables in the global scope (i.e.
> all variables except the
> > ones created inside functions and classes). print_r ($GLOBALS) will give
> you all the
> > super-global arrays ($_POST, $_GET, $_SERVER etc) as well as all user
> variables
> > created in the global scope. Look for *RECURSION* in the output; that's
> where you'll
> > find the user variables.
> >
> > Hope this helps,
> >
> > Erik
> >
>
> I think this may be it. I'll try it and let everyone know.
>
> Thanks!
>
> Jake

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: variable container?

2004-01-26 Thread memoimyself
On 26 Jan 2004 at 18:21, Jake McHenry wrote:

> yes, but they're not converted into those yet. all of the variables
> are with register_globals = on and they're all global vars. I'm
> converting them all over to session vars, this is why I need to know
> the list. 

Just an additional note to my previous post: my suggestion (print_r($GLOBALS)) will 
work irrespective of whether register_globals is on or off. The variables you create 
in the 
global scope (not the ones created from form fields or GET strings) are always global, 
even if register_globals is off.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: variable container?

2004-01-26 Thread John Nichel
Jake McHenry wrote:

There are your 'super-globals', like $_POST, $_GET, $_REQUEST,
$_SESSION, etc.  If I'm not mistaken, phpinfo() will show you all of
those, as well as php/web server configuration.


yes, but they're not converted into those yet. all of the variables are with
register_globals = on and they're all global vars. I'm converting them all
over to session vars, this is why I need to know the list.
What is not converted into what?  If you post info to a page, and 
running a version of php which supports it (4.02+ ?), the $_POST 
super-global will be there...even with register_globals off.  Do you get 
any output with




--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: variable container?

2004-01-26 Thread Jake McHenry
- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 26, 2004 6:12 PM
Subject: Re: [PHP] Re: variable container?


> Hello Jake,
>
> On 26 Jan 2004 at 17:55, Jake McHenry wrote:
>
> > I want a list of all variables used. I tried just putting var_dump() but
got
> > an error. I'd like to see a list of all variables being used in the
script,
> > then I can start cleaning original code and what I have added. Some
strange
> > results lead me to believe I'm declaring the variables more than once
with
> > different values, and I'd like to know if there is a way that I can just
get
> > a dump of ALL the variables in use. Unless I'm using the function wrong.
> > Please advise.
>
> I don't think you can print out *all* the variables in *all* scopes and
their values, but you
> can certainly get a list of all the variables in the global scope (i.e.
all variables except the
> ones created inside functions and classes). print_r ($GLOBALS) will give
you all the
> super-global arrays ($_POST, $_GET, $_SERVER etc) as well as all user
variables
> created in the global scope. Look for *RECURSION* in the output; that's
where you'll
> find the user variables.
>
> Hope this helps,
>
> Erik
>

I think this may be it. I'll try it and let everyone know.

Thanks!

Jake

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: variable container?

2004-01-26 Thread Jake McHenry
- Original Message - 
From: "John Nichel" <[EMAIL PROTECTED]>
To: "Jake McHenry" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, January 26, 2004 6:11 PM
Subject: Re: [PHP] Re: variable container?


> Jake McHenry wrote:
> 
> > I want a list of all variables used. I tried just putting var_dump() but
got
> > an error. I'd like to see a list of all variables being used in the
script,
> > then I can start cleaning original code and what I have added. Some
strange
> > results lead me to believe I'm declaring the variables more than once
with
> > different values, and I'd like to know if there is a way that I can just
get
> > a dump of ALL the variables in use. Unless I'm using the function wrong.
> > Please advise.
>
> There are your 'super-globals', like $_POST, $_GET, $_REQUEST,
> $_SESSION, etc.  If I'm not mistaken, phpinfo() will show you all of
> those, as well as php/web server configuration.
>
> -- 
> By-Tor.com
> It's all about the Rush
> http://www.by-tor.com
>

yes, but they're not converted into those yet. all of the variables are with
register_globals = on and they're all global vars. I'm converting them all
over to session vars, this is why I need to know the list.

Thanks,
Jake

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: variable container?

2004-01-26 Thread memoimyself
Hello Jake,

On 26 Jan 2004 at 17:55, Jake McHenry wrote:

> I want a list of all variables used. I tried just putting var_dump() but got
> an error. I'd like to see a list of all variables being used in the script,
> then I can start cleaning original code and what I have added. Some strange
> results lead me to believe I'm declaring the variables more than once with
> different values, and I'd like to know if there is a way that I can just get
> a dump of ALL the variables in use. Unless I'm using the function wrong.
> Please advise.

I don't think you can print out *all* the variables in *all* scopes and their values, 
but you 
can certainly get a list of all the variables in the global scope (i.e. all variables 
except the 
ones created inside functions and classes). print_r ($GLOBALS) will give you all the 
super-global arrays ($_POST, $_GET, $_SERVER etc) as well as all user variables 
created in the global scope. Look for *RECURSION* in the output; that's where you'll 
find the user variables.

Hope this helps,

Erik


Re: [PHP] Re: variable container?

2004-01-26 Thread John Nichel
Jake McHenry wrote:

I want a list of all variables used. I tried just putting var_dump() but got
an error. I'd like to see a list of all variables being used in the script,
then I can start cleaning original code and what I have added. Some strange
results lead me to believe I'm declaring the variables more than once with
different values, and I'd like to know if there is a way that I can just get
a dump of ALL the variables in use. Unless I'm using the function wrong.
Please advise.
There are your 'super-globals', like $_POST, $_GET, $_REQUEST, 
$_SESSION, etc.  If I'm not mistaken, phpinfo() will show you all of 
those, as well as php/web server configuration.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: variable container?

2004-01-26 Thread Jake McHenry
- Original Message - 
From: "Jas" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 26, 2004 5:43 PM
Subject: [PHP] Re: variable container?


> http://us4.php.net/manual/en/function.var-dump.php
> HTH
> Jas
>
> Jake McHenry wrote:
> > Is there some global variable container that I can print_r out to show
me all the variables that are being used on a page? In my efforts of
converting from globals over to sessions, I've been getting a little mis
organized with my code, and would like to know of all variables that are in
use on each page.
> >
> > Thanks,
> > Jake
> >
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

I want a list of all variables used. I tried just putting var_dump() but got
an error. I'd like to see a list of all variables being used in the script,
then I can start cleaning original code and what I have added. Some strange
results lead me to believe I'm declaring the variables more than once with
different values, and I'd like to know if there is a way that I can just get
a dump of ALL the variables in use. Unless I'm using the function wrong.
Please advise.

Thanks,
Jake

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: variable container?

2004-01-26 Thread Jas
http://us4.php.net/manual/en/function.var-dump.php
HTH
Jas
Jake McHenry wrote:
Is there some global variable container that I can print_r out to show me all the variables that are being used on a page? In my efforts of converting from globals over to sessions, I've been getting a little mis organized with my code, and would like to know of all variables that are in use on each page.

Thanks,
Jake
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php