RE: [PHP] Trimming Text

From: Date: Fri, 15 Jul 2005 15:02:54 +0000
Subject: RE: [PHP] Trimming Text
Groups: php.general 
Request: Send a blank email to php-general+get-218757@lists.php.net to get a copy of this message
[snip] Let's say that I have an original string like: This is regular text <span class="text">with some text inside a span</span> Let's say I want to trim it to 25 chars. "Brainless trimming" would give me something like "This is regular text <sp" Wich would completelly mess the design. However, if I finish the tag, the following text will be formatted by the <span class="text"> tag, thus messing the design also. It also happened to trim &nbsp; to half, having the same effect. I want to find a smart way to do this trimming in order not to have any side effects. [/snip] Trim it to 25 characters? I think we may be missing the point of your question. Can you clarify this for us? Are you wanting.... This is regular text <sp an class="text">with som e text inside a span</sp an> ?

« previous php.general (#218757) next »