开发者

Parse array data and remove the first and last character

Does anyone know if there is a way开发者_运维技巧 to remove the first and last character of array data.

Basically the [ and ] from the data that is returned.


foreach($array as $index => $d){
    $array[$index] = substr($d, 1, -1);
}


As your comment confirmed it:

It sounds like you want to use json_decode [docs]. If your data is JSON, then don't try to parse it manually.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜