Posted by Justin Koivisto on 11/10/05 23:57
Jørn Dahl-Stamnes wrote:
> I got the following code:
>
> reset ($_POST);
> while (list($key,$val) = each($_POST))
> {
> echo "$key => $val\n";
> }
>
> But this prints out nothing. If I replace the code above with:
>
>
> print_r ($_POST);
>
> I can see the content of the $_POST array. Why?
>
Try this:
$ar=$_POST;
while (list($key,$val) = each($ar))
{
echo "$key => $val\n";
}
IIRC, older PHP versions had a problem with using the each function (and
the foreach) with any of the superglobal arrays...
--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com
[Back to original message]
|