PHP Get value from JSON

后端 未结 1 1555
暗喜
暗喜 2020-12-20 03:59

Let\'s say I have this JSON:

{
  \"achievement\": [
    {
      \"title\": \"Ready for Work\",
      \"description\": \"Sign up and get validated\",
      \"         


        
相关标签:
1条回答
  • 2020-12-20 04:40

    When you set the second parameter of json_decode to true, it will return an array.

    $json_a=json_decode($string,true);
    

    returns an array.

    $getit = $json_a['achievement'][1]['title'];
    
    0 讨论(0)
提交回复
热议问题