php - getting stdclass object out of array with base64 encoded string -
hello have array here std class object inside $imagez
array(2) ( [0] => stdclass object { id => (string) 44 owner => (string) 675 relatesto => (string) userid name => (string) images.jpg type => (string) image/jpeg size => (string) 2424 image_heading => (string) ffffff image => (string) insert_dt => (string) 2016-11-08 13:08:25 update_dt => null orig_id => (string) 44 } [1] => stdclass object { id => (string) 45 owner => (string) 675 relatesto => (string) userid name => (string) masnad.jpg type => (string) image/jp...
i use $images = json_decode(json_encode($imagez), true);
odd reason not work, , returns $images
null
, if try in way $images = json_decode(json_encode($imagez[0]), true);
still null
value, me arrays without stdclass object. not sure why going wrong. base64 encoded strings containing string in image =>(string)
for case better use object notation ->
. simple foreach
trick.
//create array $storeimage = array(); foreach ($images $image){ $storeimagez[] = $image->id; $storeimagez[] = $image->owner; $storeimagez[] = $image->relatesto; // , on }
Comments
Post a Comment