diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-07-12 11:27:54 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-07-12 11:27:54 +0000 |
commit | 4f3bce79bfb5851cef9e7bc655c91bb3093cc401 (patch) | |
tree | 10a0991fddeb0e075d7fa46e2b40e5dbc64d1e88 /wp-inst/wp-content/smarty-plugins/modifier.strip.php | |
download | wordpress-mu-4f3bce79bfb5851cef9e7bc655c91bb3093cc401.tar.gz wordpress-mu-4f3bce79bfb5851cef9e7bc655c91bb3093cc401.tar.xz wordpress-mu-4f3bce79bfb5851cef9e7bc655c91bb3093cc401.zip |
Initial Import
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-content/smarty-plugins/modifier.strip.php')
-rw-r--r-- | wp-inst/wp-content/smarty-plugins/modifier.strip.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.strip.php b/wp-inst/wp-content/smarty-plugins/modifier.strip.php new file mode 100644 index 0000000..cc5c453 --- /dev/null +++ b/wp-inst/wp-content/smarty-plugins/modifier.strip.php @@ -0,0 +1,33 @@ +<?php +/** + * Smarty plugin + * @package Smarty + * @subpackage plugins + */ + + +/** + * Smarty strip modifier plugin + * + * Type: modifier<br> + * Name: strip<br> + * Purpose: Replace all repeated spaces, newlines, tabs + * with a single space or supplied replacement string.<br> + * Example: {$var|strip} {$var|strip:" "} + * Date: September 25th, 2002 + * @link http://smarty.php.net/manual/en/language.modifier.strip.php + * strip (Smarty online manual) + * @author Monte Ohrt <monte at ohrt dot com> + * @version 1.0 + * @param string + * @param string + * @return string + */ +function smarty_modifier_strip($text, $replace = ' ') +{ + return preg_replace('!\s+!', $replace, $text); +} + +/* vim: set expandtab: */ + +?> |