> 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'm thinking of something
> like DTML's sequence-start and sequence-end, in a foreach
> construction.
> 
> djo
> 


You could try implode()

$lis = implode(",", $arr);


-- 
Stig-rjan Smelror
Systemutvikler

Linux Communications AS
Sandakerveien 48b
Box 1801 - Vika
N-0123 Oslo, Norway

tel. +47 22 09 28 80
fax. +47 22 09 28 81
http://www.lincom.no/




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to