Re: [PHP] Re: cropping a string

2001-08-14 Thread Tom Carter
Thanks for the reply chris, altho that was what I had already. Guess it's down to me measuring chars myself then :-( - Original Message - From: Chris Lee [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 13, 2001 10:28 PM Subject: [PHP] Re: cropping a string function

[PHP] Re: cropping a string

2001-08-13 Thread Chris Lee
function truncate($string, $size) { $new_string = substr($string, 0, $size); $new_string = explode(' ', $new_string); array_pop($new_string); $new_string = implode(' ', $new_string); return $new_string; } this function can defn be improved apon. all this does is trims the string