这样不行么$_SESSION[]['id']=$row['id']; foreach ($_SESSION['id'] as $key=>$value){ echo $value; } 分享到: ------解决方案-------------------- $row['id']='cs'; $_SESSION['id'][]=$row['id']; foreach ($_SESSION[id] as $value){ echo $value; } ?>