encode json using php?

前端 未结 5 1751
滥情空心
滥情空心 2020-12-06 07:33

I want to get json with php encode function like the following



        
5条回答
  •  伪装坚强ぢ
    2020-12-06 08:22

    Just change that lines

    echo json_encode(array('id'=>$i, 'name' => $row['name']));
    echo ",";
    

    To these

    echo ",";
    echo json_encode(array('id'=>$i, 'name' => $row['name']));
    

提交回复
热议问题