Re: [PHP] question about variables...

2001-10-31 Thread Jason G.

READ THE MANUAL.

variable variables

$i=1;
$sName = "seat$i";
$value = $$sName;


At 04:40 PM 10/31/2001 +1100, sc wrote:
>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: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] question about variables...

2001-10-30 Thread sc

the first one that you gave me works fine... thanks for that..

-sc

"Hugh Danaher" <[EMAIL PROTECTED]> wrote in message
000d01c161cf$eb160d20$9106f4d8@win95">news:000d01c161cf$eb160d20$9106f4d8@win95...
>
> 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 <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> 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: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] question about variables...

2001-10-30 Thread Hugh Danaher


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 <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]