Re: string effect

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux