Re: srtoring user selection on the database...
| From: | Ignacio Vazquez-Abrams | Date: | Thu, 18 Jan 2001 22:52:22 +0000 |
| Subject: | Re: srtoring user selection on the database... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-35489@lists.php.net to get a copy of this message | ||
On Thu, 18 Jan 2001, Romulo Roberto Pereira wrote:
> Hey!!! thank you for your answer... what you think about this solution:
>
> while(list($key, $val) = each($cb)) {
> if ($val == 1 && $key != 0) {
> $acc = $key;
> } else {
> $acc = $acc.",".$key;
> }
>
> }
>
Even shorter:
$acc=implode(",", array_flip($cb));
> // by the way this: $acc=.$key would be a valid command? like the c++ $a =+
> $b
>
Other way: $acc.=$key, $a+=b
> Rom
>
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>