Accessing JSON object elements in PHP

前端 未结 1 1930
南旧
南旧 2020-12-21 08:28

I have a JSON object that I\'m POST\'ING to PHP from ExtJS interface. I get the object from

$json = $_POST[\"newUserInfo\"];

The object wil

相关标签:
1条回答
  • 2020-12-21 09:08

    If you are using json_decode($json,true); - true means returning the js objects results as associative arrays - then all you have to do is $user_info = $jsonDecoded['USER']; without the array() cast cause that is what json_decode do for you.

    If you would choose to omit the second boolean parameter then you will get an stdClass which $jsonDecoded->USER; would work for you

    0 讨论(0)
提交回复
热议问题