Re: Truncating
| From: | David Robley | Date: | Thu, 24 Aug 2000 02:16:23 +0000 |
| Subject: | Re: Truncating | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-13283@lists.php.net to get a copy of this message | ||
On 23 Aug, Andrew wrote:
> Hello,
>
> I have a string that I'd like to truncate to a specified amount of
> characters long. This string will then be printed to the browser. How can
> I truncate the string, and then convert all whitespaces to ?
>
> Thanks!
>
> Andrew
> digi-FX
substr() to truncate the string; then perhaps str_replace() to replace
spaces. Or you might need a regex if you have other than spaces as
whitespace. the RE experts are over there ------> :-)
Cheers
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA