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, 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 next space after 200 characters?

This should do what you want.
 
substr($str,0,strpos($str,' ',200));

Cheers,
Pablo

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to