Re: string effect

From: Date: Tue, 04 Mar 2008 17:43:49 +0000
Subject: Re: string effect
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-270950@lists.php.net to get a copy of this message
At 9:51 PM +0100 2/29/08, Alain Roger wrote:
What is the basic rule ? Text is cut off based on (numbers of words, number of characters,..) ?
Yes. Use whatever you want. You can use the number characters or find the last *space* in a string that's just long enough to fit your limit. Let's say your limit is 100 characters. 1. First truncate the string to 100 characters. 2. Then search the string for the last space. 3. Then truncate the string at that point and add "...". It will be a good exercise for you. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#270950) next »