so suppose I have this
$arr = array(some object with property a,b,c,d,etc);
and you call Zend_Json::encode($arr);
instead of encoding the object within it as well, it will just return an encoded empty array: [{}]
which is an epic fail
how do I tell Zend_Json to also encode the object within the array and not just return this failure
##################### EDITalright so I actually have this method in the class:
public function toJson(){
$params = get_object_vars($this);
return Zend_Json::encode($params);
}
yet it's still only outputting an empty array
[{}]
encoding the object itself works, but not if it's inside an array
...