$array = get_object_vars( $object );
notice! only public variable will be converted!
example :
class foo {
private $a;
public $b = 1;
public $c;
private $d;
static $e;
}
$test = new foo;
var_dump(get_object_vars($test));
The above example will output:
array(2) {
["b"]=> int(1)
["c"]=> NULL
}