RE: [PHP] dynamically naming arrays
| From: | scott [gts] | Date: | Thu, 17 May 2001 17:30:19 +0000 |
| Subject: | RE: [PHP] dynamically naming arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-53284@lists.php.net to get a copy of this message | ||
<?
$me = "foo";
${$me} = "now";
print $foo;
?>
even though it can be done, i strongly reccomend that
you re-evaluate the reasons why you want to do this.
making var-of-a-var is usually not the easiest/best
way to accomplish something....
why not use assoc. arrays??
$stuff['foo'] = explode(...);
> -----Original Message-----
> From: King, Justin [mailto:KingJ@superior.k12.wi.us]
> Sent: Thursday, May 17, 2001 1:26 PM
> To: php-general@lists.php.net
> Subject: RE: [PHP] dynamically naming arrays
>
>
> I guess I'm kind of not understanding what you're trying to do. Besides
> dynamically create an array.
>
> I'd think what you're trying would work though
>
> --Justin King, School District of Superior Web Coordinator
> (www.superior.k12.wi.us)
>
> -----Original Message-----
> From: "Matthew Luchak" <MLuchak@Kaydara.com>
> Sent: Thursday, May 17, 2001 10:27 AM
> To: php-general@lists.php.net
> Subject: [PHP] dynamically naming arrays
>
>
> any hints on dynamically naming arrays?
>
> ie:
>
> $stuff= explode ("!", $contents);
>
> //$stuff[3] is "foo"
>
> $stuff[3]=explode("&",$stuff[4]);
>
> print_r($foo);
>
> ____________________________
> Matthew Luchak
> Webmaster
> Kaydara Inc.
> mluchak@kaydara.com
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>