> -----Original Message-----
> From: Phillip S. Baker [mailto:[EMAIL PROTECTED]]
> Sent: 07 March 2002 05:52
>
> for ($i=1; $i < 12; $i++) {
> echo state_$i; // This would print out either Yes No or Maybe.
> }
Close -- it's actually:
echo ${"state_$i"};
(For the record, these are called "variable variables", and are documented at
http://www.php.net/manual/en/language.variables.variable.php).
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php