Re: [PHP] Need to dynamically globalise variables

2001-08-16 Thread Rasmus Lerdorf
Use the $GLOBALS array. On Thu, 16 Aug 2001, Tom Hodder wrote: > > I have a function like this... > > function register_db_to_globals( $row ) > { > while( list( $key, $val) = each( $row ) ) > { > global $$key; // (I've tried this with $key as well >

[PHP] Need to dynamically globalise variables

2001-08-16 Thread Tom Hodder
I have a function like this... function register_db_to_globals( $row ) { while( list( $key, $val) = each( $row ) ) { global $$key; // (I've tried this with $key as well print "$key : $val "; } } where the function prints this; j