ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Simple PHP - Truncate Text with HTML Tags

June 22, 2010 11:43am

Subscribe [1]
  • #1 / Jun 22, 2010 11:43am

    wikitect

    136 posts

    I need to be able to truncate some text that has HTML tags in it.

    In pseudo code I need to:

    substring(strip_tags('{myText}'), 0, 100);

    or something like this i.e. first remove the HTML tags and then truncate the result.

    How do I overcome the order in which PHP is parsed to be able to get EE to accept the input from a channel and then perform the PHP functions?

    I did try phpStringFun plugin but it didn’t like nested tags - there may be a better way?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases