Remove the brackets in json?

后端 未结 2 2093
悲&欢浪女
悲&欢浪女 2021-02-14 07:53

How can I get rid of the brackets below for json processing?

[{\"success\":true,\"filename\":\"bialding_and_rebialding_plymouth02.jpg\"},{\"success\":true,\"file         


        
2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-14 08:16

    You can pull out the json and return just that by doing the following inside your function:

    return $message[0];  //  only json
    

    or you can return it all and remove it afterwards:

    $uploader = new uploader();
    $result1 = $uploader->handle_upload('uploads/');
    $result2 = $result[0];
    

提交回复
热议问题