标签: php laravel laravel-5.4
代码示例:
$x = collect(["a", "b", "c"]); $x->toJson(); // => ["a","b","c"] $x->reverse()->toJson(); // => {"2":"c","1":"b","0":"a"}
正如你在反转集合后所看到的那样,json变成了一个以索引为键的对象。我该如何预防呢?如何仅输出值?