session的问题
当我一用session_start(); session_register("user1"); sess...
作者 chenglf 发布于 2003-07-01 分类:php基础编程
如何取得$_POST数组的所有元素?对方POST过来的内容.我要求将他的变量名及内容全部显示出来!应该如何做?
逛论坛交流:如何取得$_post数组的所有元素?
//$_POST数组的所有元素
foreach($_POST as $k => $v) {
$_POST[$k] => $v;
}
//变量名及内容全部显示出来
print_r($_POST);
$_POST[$k] => $_v; 通不过,
我改成这样就好了.
<?
$postvars = array();
foreach($_POST as $ipnkey => $ipnvalue)
{
$GLOBALS[$ipnkey] = $ipnvalue;
$postvars[] = $ipnkey;
}
$text="";
for ($x=0; $x < count($postvars); $x++)
{
$text .= $postvars[$x] . " = ";
$text .= $$postvars[$x] . "
";
}
print $text;
?>
2 条回复
回复