Strip of HTML and cut a piece of text, either by character or word count.
A couple of simple php functions that, when passed a string of text and a length value, strips the text of html tags and markup, and cuts it to the specified length.
clencut_w returns the given number of words or less, cleancut_c returns given number of characters or less. Only complete words are returned.
They can be called as
cleancut_c($string,$length=50) from any template file.
<?php $text_clean = cleancut_w($sometext,50); echo $text_clean; ?>.
Requires: 2.0 or higher
Compatible up to: 3.1.4
Last Updated: 6 years ago
Active Installs: Less than 10
Got something to say? Need help?