Can anyone tell me how to access name from below code :
How to access stdclass object
stdClass Object
(
[formdata] => [{"name":"aaa"},{"designation":""},{"organization":""},{"country":""},{"email":""},{"phone":""},{"status":""},{"interest":[]},{"comment":""},{"radio":""}]
)
you can do it like this
$obj = stdClass Object
(
[formdata] => [{"name":"aaa"},{"designation":""},{"organization":""},{"country":""},{"email":""},{"phone":""},{"status":""},{"interest":[]},{"comment":""},{"radio":""}]
)
$newdata = json_decode(json_encode($obj), True);
$data = json_decode($newdata['formdata'], True);
echo '<pre>';print_r($data);
die;
it will give you and array and you can access each variables
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.