Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function split_content($words = 15) {
- $str = strip_tags($item->get_content());
- $a = preg_split("/[\s]+/", $str, $words + 1);
- $a = array_slice($a, 0, $words);
- $final_content = join(' ', $a);
- echo $final_content;
- }
- ?>
Add Comment
Please, Sign In to add comment