How about;

list($column1, $column2, $column3) = array("wheat2", "rye2",
"pumpernickel2");

Not totaly flexible as below.  But it satisfies the question. Needs php4.

Paul Kozlenko

"Jay Lepore" <[EMAIL PROTECTED]> wrote in message
9dcp7h$tjr$[EMAIL PROTECTED]">news:9dcp7h$tjr$[EMAIL PROTECTED]...
> I would like to loop through an array and create variable names such as
> column1, column2, column3 etc. where the number at the end comes from the
> value of index.
>
> For instance:
>
> 1) $toast=array("wheat", "rye", "pumpernickel");
> 2) $numbreads=count($toast);
> 3)     for($index=0;$index<$numbreads;$index++){
> 4)         $column$index=$toasts[$index];
> 5)     }
>
> At the end I would in theory have three fields called column1, column2,
> column3.
>
> How can I append $index to another to make a new variable name as shown in
> line 4 ?
>
> Thanks in advance
>
> Jay
>
>
>
> --
> 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]

Reply via email to