Re: [PHP] printing comma-delimited lists

2001-10-04 Thread David Otton
On Thu, 4 Oct 2001 16:27:11 +0200 (CEST), you wrote: >You could try implode() > >$lis = implode(",", $arr); That'll do it; thanks. djo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the

Re: [PHP] printing comma-delimited lists

2001-10-04 Thread Stig-Ørjan Smelror
> What I'm doing here is fairly obvious (build a comma-delimited >string). > > $arr = array(1,2,3,4,5); > > for ($i=0; $i< sizeof($arr); $i++) { > $lis = $lis . $arr[$i]; > if ($i != (sizeof($arr)-1)) { > $lis = $lis . ','; > } > } > > > Question is, is there a

[PHP] printing comma-delimited lists

2001-10-04 Thread David Otton
What I'm doing here is fairly obvious (build a comma-delimited string). $arr = array(1,2,3,4,5); for ($i=0; $i< sizeof($arr); $i++) { $lis = $lis . $arr[$i]; if ($i != (sizeof($arr)-1)) { $lis = $lis . ','; } } Question is, is there a more elegant way? I