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.
精彩评论