Re: Tough one?
| From: | Simon Garner | Date: | Thu, 22 Feb 2001 09:24:23 +0000 |
| Subject: | Re: Tough one? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-41113@lists.php.net to get a copy of this message | ||
From: "Tim Ward" <tim.ward@stivesdirect.com>
> a quite neat (though maybe no more efficient) way would be ...
>
> $keys = array_keys($HTTP_POST_VARS);
> $key_list = array();
> foreach($keys as $fred)
> { $key_list() = $fred."='".$HTTP_POST_VARS[$fred]."'";
> }
> $updateString=$updateString.implode(",", $key_list)."'";
>
> ... I haven't tested the detail of this but the theory is sound, I'm
fairly
> sure.
>
> Tim Ward
> Senior Systems Engineer
>
> Please refer to the following disclaimer in respect of this message:
> http://www.stivesdirect.com/e-mail-disclaimer.html
>
>
Your syntax is a bit convoluted there :-P
You could just do:
<?php
foreach ($HTTP_POST_VARS as $var => $value)
{
$vars[] = "$key=$value";
}
echo implode(",", $vars);
?>