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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Wed Jun 16 21:58:17 2004 UTC (20 years, 2 months ago) by joko
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +20 -10 lines
updated to smarty-2.6.3

1 joko 1.1 <?php
2 joko 1.2 /**
3     * Smarty plugin
4     * @package Smarty
5     * @subpackage plugins
6     */
7 joko 1.1
8 joko 1.2
9     /**
10     * Smarty strip modifier plugin
11     *
12     * Type: modifier<br>
13     * Name: strip<br>
14 joko 1.1 * Purpose: Replace all repeated spaces, newlines, tabs
15 joko 1.2 * with a single space or supplied replacement string.<br>
16 joko 1.1 * Example: {$var|strip} {$var|strip:"&nbsp;"}
17     * Date: September 25th, 2002
18 joko 1.2 * @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 joko 1.1 */
26     function smarty_modifier_strip($text, $replace = ' ')
27     {
28 joko 1.2 return preg_replace('!\s+!', $replace, $text);
29 joko 1.1 }
30    
31     /* vim: set expandtab: */
32    
33     ?>

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