RE: [PHP] stdClass to array

2005-01-11 Thread Michael Sims
Cere Davis wrote: > Hey folks, > > Does anyone know of a painless way to convert a stdClass object to an > associative array in php? Just cast it: $arr = (array) $stdClassInstance; > Also, I wonder, is there a way to "flatten" associative arrays in php? > So say: > $b=new array(s=>"S") > $a=new

[PHP] stdClass to array

2005-01-11 Thread Cere Davis
Hey folks, Does anyone know of a painless way to convert a stdClass object to an associative array in php? Also, I wonder, is there a way to "flatten" associative arrays in php? So say: $b=new array(s=>"S") $a=new array(a=>"A",b=>$b) goes to: $z=flatten($a); z turns to: (a=>"A", b=>$b, s=>