I have a parameter $return.
When I set "print_r($return);" I get the following:
{"allresponses":"{\"adm_big_picture\":null,\"adm_group\":null,\"adm_group_message\":null,\"adm_large_icon\":null,\"adm_small_icon\":null,\"adm_sound\":null,\"amazon_background_data\":false,\"android_accent_color\":null,\"android_group\":null,\"android_group_message\":null,\"android_led_color\":null,\"android_sound\":null,\"android_visibility\":null,\"app_id\":\"XXXX\",\"big_picture\":null,\"buttons\":null,\"canceled\":false,\"chrome_big_picture\":null,\"chrome_icon\":null,\"chrome_web_icon\":\"\",\"chrome_web_image\":\"\",\"content_available\":false,\"contents\":{\"en\":\"This is a new message.\"},\"converted\":0,\"data\":null,\"delayed_option\":\"immediate\",\"delivery_time_of_day\":\"4:00 PM\",\"errored\":0,\"excluded_segments\":[],\"failed\":0,\"firefox_icon\":\"\",\"headings\":{\"en\":\"New Message\"},\"id\":\"12\",\"include_player_ids\":null,\"included_segments\":[\"All\"],\"ios_badgeCount\":null,\"ios_badgeType\":null,\"ios_category\":null,\"ios_sound\":null,\"isAdm\":false,\"isAndroid\":false,\"isChrome\":false,\"isChromeWeb\":true,\"isFirefox\":true,\"isIos\":false,\"isSafari\":true,\"isWP\":false,\"isWP_WNS\":false,\"large_icon\":null,\"priority\":null,\"queued_at\":1492523636,\"remaining\":0,\"send_after\":1492523636,\"small_icon\":null,\"successful\":3,\"tags\":null,\"filters\":null,\"template_id\":null,\"ttl\":null,\"url\":\"\",\"web_buttons\":null,\"wp_sound\":null,\"wp_wns_sound\":null}"}
I would like to take specific values and assign them to a parameter, for example to take value of app_id and set it as a value of $appId so when I do echo $appId, the value xxxx is printed on screen.
Have tried using the following, but not returning results:
$obj= json_decode($return);
$appId = $obj->allresponses->app_id;
echo $appId;
Can someone guide me please?
Thanks :)