On Thursday 20 February 2003 13:36, Michael P. Carel wrote: > 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?
Just use: $rest = substr("abcdef", 0, -1); // returns "abcde" to chop off the last character (comma). -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * ------------------------------------------ Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general ------------------------------------------ /* In a medium in which a News Piece takes a minute and an "In-Depth" Piece takes two minutes, the Simple will drive out the Complex. -- Frank Mankiewicz */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php