Re: Tough one?
| From: | John Monfort | Date: | Thu, 22 Feb 2001 01:35:03 +0000 |
| Subject: | Re: Tough one? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-41089@lists.php.net to get a copy of this message | ||
Actually, you may not have to do all that.
you can use implode().
By default, implode will join an array, with the supplied character.
So, if you have
$list = (one two three four);
you can do
$all = implode("," , $list);
to get
$all = "one,two,three,four";
This works pretty well...
enjoy!
__________John Monfort_________________
_+-----------------------------------+_
P E P I E D E S I G N S
www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-
On Wed, 21 Feb 2001, Jason Stechschulte wrote:
> On Wed, Feb 21, 2001 at 01:34:10PM -0500, Mike wrote:
> > $keys = array_keys($HTTP_POST_VARS);
> > for($x = 2; $x < count($keys); $x++)
> > {
> >
> > $updateString=$updateString.$keys[$x]."='".$HTTP_POST_VARS[$keys[$x]]."',";
>
> }
> $updateString = ereg_replace(",$", "", $updateString);
>
> That should take care of the trailing comma.
>
>
> --
> Jason Stechschulte
> jpstech@unoh.edu
> --
> One of the reasons Perl is faster than certain other unnamed interpreted
> languages is that it binds variable names to a particular package (or
> scope) at compile time rather than at run time.
> -- Larry Wall in <199709050035.RAA29328@wall.org>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>