RE: [PHP-WIN] Naming Variables Based on Variable Content
| From: | Fernando Madruga | Date: | Wed, 21 Mar 2001 14:11:00 +0000 |
| Subject: | RE: [PHP-WIN] Naming Variables Based on Variable Content | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-6188@lists.php.net to get a copy of this message | ||
An example:
<?
$MyVar = "Contents";
$$MyVar = "Will it work?";
echo "\$Contents = $Contents\n";
?>
This will echo
$Contents = Will it work?
HTH,
Fernando Madruga
-----Original Message-----
From: Michael Rudel [mailto:mru@suchtreffer.de]
Sent: quarta-feira, 21 de Março de 2001 14:14
To: 'Will Degener'; 'Php-Windows (E-mail)'
Subject: RE: [PHP-WIN] Naming Variables Based on Variable Content
Sure,
$MyVar = "Contents";
$$MyVar equals $Contents.
Taken from the Manual, Language Reference (which everyone should read first
=8),
Chapter 7: Variables / Variable Variables
Greetinx,
Mike
Michael Rudel
- Web-Development, Systemadministration -
_______________________________________________________________
Suchtreffer AG
Bleicherstraße 20
D-78467 Konstanz
Germany
fon: +49-(0)7531-89207-17
fax: +49-(0)7531-89207-13
e-mail: mailto:mru@suchtreffer.de
internet: http://www.suchtreffer.de
_______________________________________________________________
> -----Original Message-----
> From: Will Degener [mailto:WillD@support-works.com]
> Sent: Wednesday, March 21, 2001 3:01 PM
> To: Php-Windows (E-mail)
> Subject: [PHP-WIN] Naming Variables Based on Variable Content
>
>
> Any ideas if this is possible and if so how ???
> Thanks in advance. - Will
>
> If I have a variable :
>
> $MyVar = "Contents";
>
> Can I create a variable at "runtime" that has a name based on
> the contents
> of $MyVar ?
> eg
>
> $Contents
>
>
>
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
For additional commands, e-mail: php-windows-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net