$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";
来个2一点的 替换 \r\n 成 , 然后还原成数组...其他的...你看着办
来个2一点的 替换 \r\n 成 , 然后还原成数组...其他的...你看着办
能否贴点代码。大牛哥。。
explode("\r\n", )
explode(",", )
$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'];
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号