Re: [PHP] Name of an array???

2001-07-09 Thread Steve Edberg

Not quite sure what you're getting at here. As you discovered, if you have

$Thing = array(5,6,7,8);

and you 'echo $Thing;' you get 'Array.' However, in this case, you 
know the variable name already - $Thing!

Are you thinking more along these lines:

$ArrayName = 'Thing';
$$ArrayName = array(5,6,7,8);

now,

echo $ArrayName;==> Thing
echo $$ArrayName;   ==> Array
echo ${$ArrayName}[0];  ==> 5

See

http://www.php.net/manual/en/language.variables.variable.php

for more info.

-steve



At 1:03 PM -0700 7/9/01, Dallas K. wrote:
>I need to echo the NAME of an array to the browser. when I try 
>this all I get is "Array". when I try to : echo $$array_name; I 
>get nothing.
>
>How can I get the NAME of an array to the browser?
>
>Thanks.

-- 
+-- Factoid: Of the 100 largest economies in the world, 51 are --+
| Steve Edberg   University of California, Davis |
| [EMAIL PROTECTED]   Computer Consultant |
| http://aesric.ucdavis.edu/  http://pgfsun.ucdavis.edu/ |
+--- corporations -- http://www.ips-dc.org/reports/top200text.htm ---+

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] Name of an array???

2001-07-09 Thread scott [gts]

you mean output the name of the variable??

what are you trying to do with that?

> -Original Message-
> From: Dallas K. [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 09, 2001 4:04 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Name of an array???
> Importance: High
> 
> 
> I need to echo the NAME of an array to the browser. when I try this 
> all I get is "Array". when I try to : echo $$array_name; I get nothing.
> 
> How can I get the NAME of an array to the browser?
> 
> Thanks.
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Name of an array???

2001-07-09 Thread Dallas K.

I need to echo the NAME of an array to the browser. when I try this all I get is 
"Array". when I try to : echo $$array_name; I get nothing.

How can I get the NAME of an array to the browser?

Thanks.