日期:2014-05-17 浏览次数:20485 次
$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'];