$arr = array(
foreach ($list->list as $json) {
"file"=>str_replace('99552', '', $json->path)
}
);
我这样写提示Parse error: syntax error, unexpected T_FOREACH, expecting ')',该如何修改?
伊谢尔伦2017-04-10 17:29:52
$arr = array();
foreach ($list->list as $json)
{
$arr[] = array(
"file"=>str_replace('99552', '', $json->path);
);
}
大家讲道理2017-04-10 17:29:52
$arr = array();
foreach ($list->list as $json)
{
$arr[] = str_replace('99552', '', $json->path);
}
var_dump($arr);
即可。