Re: cut text?

From: Date: Tue, 11 Jun 2002 20:02:06 +0000
Subject: Re: cut text?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-101606@lists.php.net to get a copy of this message
I'd probably use substr. For the first 30 characters plus three full stops (untested): $shortstring = substr($longstring,0,30)."..."; The manual shows all the string handling functions http://www.php.net/manual/en/ref.strings.php Regards Chris Hawk wrote:
Lets say I have a news text, and in a menu, I just want to print the first.. lets say 30 letters, and maybe add a "..." after, and link it to the full text.


« previous php.general (#101606) next »