R.Livsey <R.Livsey at cache-22.co.uk> typed: > /* pads a string $to_pad upto length $length padding with > $pad_char. */ > function pad($to_pad, $length, $pad_char) > { > while (strlen($to_pad)<$length) > { > $to_pad = $pad_char . $to_pad; > } > return $to_pad; > } Just a tip: your pad() function is really unnecessary, since PHP already has the sprintf() function for this purpose. To left-pad a string with zeros, you can use this: $id = sprintf("%05d", $id); charles johnson lgf web design http://littlegreenfootballs.com