note 91448 added to language.variables.variable
| From: | WimMarin at osu1 dot php dot net | Date: | Wed, 10 Jun 2009 12:41:45 +0000 |
| Subject: | note 91448 added to language.variables.variable | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-156739@lists.php.net to get a copy of this message | ||
I think the solution of Mark Stoddart isn't the best way to do this.
A better way -I think- is to use a temporary variable:
<?php
$bar = 'chocolat';
$foo_chocolat = 'yummie';
$tmp = 'foo_'.$bar;
echo $$tmp; //output: yummie
----
Server IP: 193.190.67.11
Probable Submitter: 81.247.97.107
----
Manual Page -- http://www.php.net/manual/en/language.variables.variable.php
Edit -- https://master.php.net/note/edit/91448
Del: integrated -- https://master.php.net/note/delete/91448/integrated
Del: useless -- https://master.php.net/note/delete/91448/useless
Del: bad code -- https://master.php.net/note/delete/91448/bad+code
Del: spam -- https://master.php.net/note/delete/91448/spam
Del: non-english -- https://master.php.net/note/delete/91448/non-english
Del: in docs -- https://master.php.net/note/delete/91448/in+docs
Del: other reasons-- https://master.php.net/note/delete/91448
Reject -- https://master.php.net/note/reject/91448
Search -- https://master.php.net/manage/user-notes.php