开发者

Parse array data and remove the first and last character

开发者 https://www.devze.com 2023-04-02 17:16 出处:网络
Does anyone know if there is a way开发者_运维技巧 to remove the first and last character of array data.

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

精彩评论

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