[PHP] Shortening a String

2003-10-28 Thread Jason Williard
I would like to display part of the output of a query. In many cases, the string returned by this query exceeds 200 characters. Is there a way to cut it off after 200 characters? Even better, is there a way to cut it off at the next space after 200 characters? Thank you for any assistance, -

RE: [PHP] Shortening a String

2003-10-28 Thread Martin Towell
substr($str, 0, 200); or an (untested) ereg ereg((.{200}[^ ]*), $str, $bits); HTH Martin -Original Message- From: Jason Williard [mailto:[EMAIL PROTECTED] Sent: Wednesday, 29 October 2003 1:53 PM To: [EMAIL PROTECTED] Subject: [PHP] Shortening a String I would like to display part

RE: [PHP] Shortening a String

2003-10-28 Thread Pablo Gosse
On Tuesday, October 28, 2003 6:53 PM Jason Williard wrote: I would like to display part of the output of a query. In many cases, the string returned by this query exceeds 200 characters. Is there a way to cut it off after 200 characters? Even better, is there a way to cut it off at the

RE: [PHP] Shortening a String

2003-10-28 Thread Jason Williard
Thanks. That's exactly what I was looking for and is working perfectly. - Jason -Original Message- From: Pablo Gosse [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 28, 2003 7:18 PM To: Jason Williard; [EMAIL PROTECTED] Subject: RE: [PHP] Shortening a String On Tuesday, October 28

Re: [PHP] Shortening a String

2003-10-28 Thread John W. Holmes
Jason Williard wrote: I would like to display part of the output of a query. In many cases, the string returned by this query exceeds 200 characters. Is there a way to cut it off after 200 characters? Even better, is there a way to cut it off at the next space after 200 characters? Read this