我把我的程序上传到空间报错了找到原因后发现next()方法好像总是先执行一次似地 foreach ($crs as $k= $value) { $xiang =""; echo key($crs)."br"; if(key($crs)=="name"){ $xiang = 13; }if(key($crs)=="zhiwu"){ $xiang = 14; }if(key($crs)=="tel"){ $xi
我把我的程序上传到空间报错了找到原因后发现next()方法好像总是先执行一次似地 foreach ($crs as $k=> $value) {
$xiang ="";
echo key($crs)."
";
if(key($crs)=="name"){
$xiang = 13;
}if(key($crs)=="zhiwu"){
$xiang = 14;
}if(key($crs)=="tel"){
$xiang = 15;
}if(key($crs)=="email"){
$xiang = 16;
}if(key($crs)=="password"){
$xiang = 17;
}
next($crs);
$lsjl->addlsjl($kuai,$xiang,json_encode($yrs),json_encode($xrs));
}
数据crs =Array ( [name] => 312333 [zhiwu] => 123333 [tel] => 121343333 [email] => 121343333 )
打印出的结果是
服务器
zhiwu
tel
email
本地输出结果
name
zhiwu
tel
email
求帮助