时间:2021-07-01 10:21:17 帮助过:29人阅读
$getstr="id=189,pc=0,pt=0,valide=1\r\nid=176,pc=0,pt=0,valide=1\r\nid=177,pc=0,pt=0,valide=1\r\n";
$getstr = "id=189,pc=0,pt=0,valide=1\r\nid=176,pc=0,pt=0,valide=1\r\nid=177,pc=0,pt=0,valide=1\r\n";
foreach(explode("\r\n", $getstr) as $row) {
if($row) {
parse_str(strtr($row, ',', '&'), $t);
$res[] = $t;
}
}
echo $res[0]['id'];