Removing array index reference when using json_encode()

后端 未结 3 2096
不知归路
不知归路 2020-11-27 19:08

I have made a small application using jQuery\'s datepicker. I am setting unavailable dates to it from a JSON file which looks like this:

{ \"dat         


        
3条回答
  •  攒了一身酷
    2020-11-27 19:21

    In Laravel collections(just in case) you can do

        $newArray = $collection->values()->toArray();
    

    or

        $jsonEncoded = $collection->values()->toJson();
    

提交回复
热议问题