/[cvs]/nfo/php/libs/net.php.smarty/plugins/modifier.strip.php
ViewVC logotype

Diff of /nfo/php/libs/net.php.smarty/plugins/modifier.strip.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by joko, Thu Dec 19 16:40:20 2002 UTC revision 1.2 by joko, Wed Jun 16 21:58:17 2004 UTC
# Line 1  Line 1 
1  <?php  <?php
2    /**
 /*  
3   * Smarty plugin   * Smarty plugin
4   * -------------------------------------------------------------   * @package Smarty
5   * Type:     modifier   * @subpackage plugins
6   * Name:     strip   */
7    
8    
9    /**
10     * Smarty strip modifier plugin
11     *
12     * Type:     modifier<br>
13     * Name:     strip<br>
14   * Purpose:  Replace all repeated spaces, newlines, tabs   * Purpose:  Replace all repeated spaces, newlines, tabs
15   *           with a single space or supplied replacement string.   *           with a single space or supplied replacement string.<br>
16   * Example:  {$var|strip} {$var|strip:"&nbsp;"}   * Example:  {$var|strip} {$var|strip:"&nbsp;"}
  * Author:   Monte Ohrt <monte@ispi.net>  
  * Version:  1.0  
17   * Date:     September 25th, 2002   * Date:     September 25th, 2002
18   * -------------------------------------------------------------   * @link http://smarty.php.net/manual/en/language.modifier.strip.php
19     *          strip (Smarty online manual)
20     * @author   Monte Ohrt <monte@ispi.net>
21     * @version  1.0
22     * @param string
23     * @param string
24     * @return string
25   */   */
26  function smarty_modifier_strip($text, $replace = ' ')  function smarty_modifier_strip($text, $replace = ' ')
27  {  {
28          return preg_replace('!\s+!', $replace, $text);      return preg_replace('!\s+!', $replace, $text);
29  }  }
30    
31  /* vim: set expandtab: */  /* vim: set expandtab: */

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed