Array
(
[一般检查] => Array
(
[0] => 身高
[1] => 体重
[2] => 视力
)
[内科] => Array
(
[0] => 主要病史
[1] => 血压
[2] => 发育
[3] => 胸廓
[4] => 肺部
[5] => 心界
[6] => 心音
[7] => 节律
[8] => 脾
[9] => 肾
[10] => 神经系统
)
[外科] => Array
(
[0] => 主要病史
[1] => 皮肤
[2] => 淋巴结
[3] => 甲状腺
[4] => 脊柱
[5] => 四肢
)
)
This is the returned content. It looks like an array but is actually a string. How to make it really become an array!
Then I want to combine it into this structure and display it on the front end (I have no idea at all, please educate me) ps: The outer layer li displays the key, and the inner layer displays the details corresponding to the key! ~~
<ul>
<li>
<ul>
<li></li>
</ul>
</li>
</ul>
The backend converts the output content into json format
The front end converts json string into array
It’s a backend problem, either json or xml is used to transmit data. This kind of data cannot be parsed by the frontend.
If json is returned in the background, get the json returned by ajax. There are two ways to parse and get js objects
You’re welcome
JSON.parse(res)
You can use json structure.
For example:
Ask him to correct the back-end problem
It looks a bit like the information from PHPvar_dump. First, confirm the data key json returned by the backend to make the front-end processing simple