fc675582012c463e5f7f314b52a310876e67da65
[atutor.git] / mods / phpdoc2 / PhpDocumentor / phpDocumentor / Smarty-2.6.0 / libs / plugins / modifier.strip.php
1 <?php\r
2 /**\r
3  * Smarty plugin\r
4  * @package Smarty\r
5  * @subpackage plugins\r
6  */\r
7 \r
8 \r
9 /**\r
10  * Smarty strip modifier plugin\r
11  *\r
12  * Type:     modifier<br>\r
13  * Name:     strip<br>\r
14  * Purpose:  Replace all repeated spaces, newlines, tabs\r
15  *           with a single space or supplied replacement string.<br>\r
16  * Example:  {$var|strip} {$var|strip:"&nbsp;"}\r
17  * Date:     September 25th, 2002\r
18  * @link http://smarty.php.net/manual/en/language.modifier.strip.php\r
19  *          strip (Smarty online manual)\r
20  * @author   Monte Ohrt <monte@ispi.net>\r
21  * @version  1.0\r
22  * @param string\r
23  * @param string\r
24  * @return string\r
25  */\r
26 function smarty_modifier_strip($text, $replace = ' ')\r
27 {\r
28         return preg_replace('!\s+!', $replace, $text);\r
29 }\r
30 \r
31 /* vim: set expandtab: */\r
32 \r
33 ?>\r