Re: [PHP] foreach loop to set variables

2008-04-25 Thread Jim Lucas
jamest wrote: I am passing an array to a class which I want to take the array data and create some variables from the array's keys and values. So I want to create (in this case 21) new variables that I want to create in the foreach but with no success. foreach ($formdata as $key => $value) {

Re: [PHP] foreach loop to set variables

2008-04-25 Thread jamest
Thats perfect. I didn't even know about this. Stut wrote: > > > $$key = $value; > > They're called variable variables - search the manual for that term > for more info. > > -Stut > > -- > http://stut.net/ > > -- View this message in context: http://www.nabble.com/foreach-loop-to-set

Re: [PHP] foreach loop to set variables

2008-04-25 Thread Casey
On Apr 25, 2008, at 6:12 AM, jamest <[EMAIL PROTECTED]> wrote: I am passing an array to a class which I want to take the array data and create some variables from the array's keys and values. So I want to create (in this case 21) new variables that I want to create in the foreach but wit

Re: [PHP] foreach loop to set variables

2008-04-25 Thread Jason Norwood-Young
On Fri, 2008-04-25 at 06:12 -0700, jamest wrote: > I am passing an array to a class which I want to take the array data and > create some variables from the array's keys and values. > > So I want to create (in this case 21) new variables that I want to create in > the foreach but with no success.

Re: [PHP] foreach loop to set variables

2008-04-25 Thread Stut
On 25 Apr 2008, at 14:12, jamest wrote: I am passing an array to a class which I want to take the array data and create some variables from the array's keys and values. So I want to create (in this case 21) new variables that I want to create in the foreach but with no success. foreach ($f

[PHP] foreach loop to set variables

2008-04-25 Thread jamest
I am passing an array to a class which I want to take the array data and create some variables from the array's keys and values. So I want to create (in this case 21) new variables that I want to create in the foreach but with no success. foreach ($formdata as $key => $value) { echo "$ke