1<?php 2/** 3 * template_lite {strip}{/strip} block plugin 4 * 5 * Type: block function 6 * Name: strip 7 * Purpose: strip unwanted white space from text 8 * Credit: Taken from the original Smarty 9 * http://smarty.php.net 10 */ 11function tpl_block_strip($params, $content, &$tpl) 12{ 13 $_strip_search = array( 14 "![\t ]+$|^[\t ]+!m", // remove leading/trailing space chars 15 '%[\r\n]+%m', // remove CRs and newlines 16 ); 17 $_strip_replace = array( 18 '', 19 '', 20 ); 21 return preg_replace($_strip_search, $_strip_replace, $content); 22} 23?>