Re: question about variables...
| From: | Hugh Danaher | Date: | Wed, 31 Oct 2001 05:50:12 +0000 |
| Subject: | Re: question about variables... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-72983@lists.php.net to get a copy of this message | ||
SC
What you want should look something like this: ${"seat".$p}
where $p can be incremented in a loop.
However, I was advised to use an array which would look something like this:
$seat[$p]
where $p can also be incremented in a loop.
Hope this helps.
hugh
----- Original Message -----
From: sc <sven@gstar.com.au>
To: <php-general@lists.php.net>
Sent: Tuesday, October 30, 2001 9:40 PM
Subject: [PHP] question about variables...
> Hey all;
>
> If i have a variable say, $seat and i want to go through variables with a
> number, ie. $seat1 , $seat2 etc. how would i go about it? i have one setup
> where $p increments (so then you have $seat$p) but i cant get it to work
> properly (tried all sorts of combinations with ' and " and . etc.)...and
> cant seem to find any info on it (dont really know what to search for)..
>
> Anyone know how one can go about it?
>
> thx.
>
> -sc
>
>
>
> --
> 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
>