Quick Search:
 
 PHP Code: Truncate text while preserving HTML tags Jump to:  
Category: >> PHP Code >> Truncate text while preserving HTML tags  

<< lastnext >>

Snippet Name: Truncate text while preserving HTML tags

Description: Truncate or limit a text string while still preserving any HTML tags present. The code auto-closes the tags.

Also see:
» BR2NL Function: Opposite of NL2BR
» Truncate text while preserving HTML ta...
» Neatly trim a string to a set number o...
» Truncate Links Over X Chars long
» String Functions: LTRIM
» String Functions: RTRIM
» Number Functions: Truncate to n
» Number Functions: Truncate
» Improved Strip_Tags()
» Get text between tags
» Convert BBCode Tags
» Truncate URLs for clean appearance.

Comment: (none)

Language: PHP
Highlight Mode: PHP
Last Modified: May 27th, 2010

ECHO String::truncate('jo<i><b>n</b>as</i>', 3, '...'); //jo<...
ECHO String::truncate('jo<i><b>n</b>as</i>', 3, '...', TRUE); //jo<i><b>n</b></i>...
ECHO String::truncate('jo<i><b>n</b>as</i>', 3, '...', TRUE, FALSE); //jo<i><b>n...
 


 
   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org