how could extract function returned value through object
<p>The <code>add_img($whichimg)</code> function is in a class. 
I need to retrieve data from return array.
It's a blueimp image uploader script. I am editing it as my requirement.</p>

<p>If I print <code>$file-&gt;added_data</code> then result is <code>[object Object]</code> but I need a real value.</p>

<pre><code>function add_img($whichimg) { 
    ...
    return $added_data = array( "parent_img_id"=&gt;$parent_img_id, 
                                "child_imgs_id"=&gt;$child_imgs_id ); 
} 



function value_to_json() {

    $file = new stdClass();

    ...

     $file-&gt;added_data = $this-&gt;add_img($file-&gt;name); 
     $file-&gt;parent_id = $this-&gt;added_data['parent_img_id']; 
     $file-&gt;child_id = $this-&gt;added_data['child_imgs_id'];
}
</code></pre>
