note 21647 added to language.variables.variable
| From: | juadielon_NOSPAM at hotmail dot com | Date: | Wed, 22 May 2002 03:37:40 +0000 |
| Subject: | note 21647 added to language.variables.variable | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-30881@lists.php.net to get a copy of this message | ||
//So you used some variables to store values:
$a1=one;
$a2=two;
$a3=three;
//And for instance you want to display them without typing again the variables
for ($i=1; $i<=3; $i++) {
$b=${'a'.$i}; //this is the important one
echo $b;
}
//The result should be onetwothree
This code alone probably doesnt mean anything, but if you adapt this to your needs soon you will
discover the power of PHP.
--
http://www.php.net/manual/en/language.variables.variable.php
http://master.php.net/manage/user-notes.php?action=edit+21647
http://master.php.net/manage/user-notes.php?action=delete+21647
http://master.php.net/manage/user-notes.php?action=reject+21647