note 26282 added to function.is-array
| From: | php-general at lists dot php dot net | Date: | Thu, 24 Oct 2002 22:04:20 +0000 |
| Subject: | note 26282 added to function.is-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-38522@lists.php.net to get a copy of this message | ||
/* building a form parsing $HTTP_POST-VARS and debugging arrays */
<html>
<head><title>My form page</title>
</head>
<body>
<form name="form1" action="receiving_script" method="POST">
<?
if (sizeof($HTTP_POST_VARS)>0)
{
reset ($HTTP_POST_VARS);
while (list ($variable, $value) = each ($HTTP_POST_VARS))
{
$$variable=$value;
if (is_array($value) && sizeof($value) > 0)
{
reset ($value);
while (list ($arrkey, $arrval) = each ($value))
{
?>
<input type="hidden" name="<? print $variable
?>[<? print $arrkey; ?>]" value="<? print $arrval ?>">
<?
$array=$variable."[".$arrkey."]";
$$array=$arrval;
// print $array." => ".$$array;
}
}
else
{
?>
<input type="hidden" name="<? print $variable
?>" value="<? print $value ?>">
<?
$$variable=$value;
//print $$variable;
}
}
}
?>
<input type="submit" value="Go!">
</form>
</body>
</html>
--
http://www.php.net/manual/en/function.is-array.php
http://master.php.net/manage/user-notes.php?action=edit+26282
http://master.php.net/manage/user-notes.php?action=delete+26282
http://master.php.net/manage/user-notes.php?action=reject+26282