as per testing it doesnt delete the last comma, i'm doing something like
this:
for($i=0;$i<sizeof($images);$i++)
{
$pictures .="\"./archive/bannerimages/".$bid[$i]."/".$images[$i]."\"".",";
}
preg_replace("/,$/","",$pictures);
echo $pictures;
is there something wrong with pre_replace?
----- Original Message -----
From: "Chris Cook" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 12:42 PM
Subject: Re: [PHP] array values format
> Hi Michael,
>
> Something like this should work:
>
> for($i=0; $i<sizeof($array); $i++)
> {
> $data .= $array[$i] . ", ";
> }
> preg_replace("/, $/", "", $data);//get rid of last comma
> echo $data;
>
> Good luck,
> Chris
>
>
> >From: "Michael P. Carel" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Subject: [PHP] array values format
> >Date: Thu, 20 Feb 2003 11:53:18 +0800
> >
> >hi to all
> >
> >
> >I have a problem here in array manipulations. I need an output like this
> >from the queried data :
> >
> >"data1","data2","data3"
> >
> >Any idea how? thanx in advance
> >
> >
> >
> >mike
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> _________________________________________________________________
> STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php