Kyberia v2.0
[mirrors/Kyberia-bloodline.git] / inc / smarty / node_methodz / modifier.strip_tags.php
diff --git a/inc/smarty/node_methodz/modifier.strip_tags.php b/inc/smarty/node_methodz/modifier.strip_tags.php
new file mode 100644 (file)
index 0000000..45f1ec1
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty strip_tags modifier plugin
+ *
+ * Type:     modifier<br>
+ * Name:     strip_tags<br>
+ * Purpose:  strip html tags from text
+ * @link http://smarty.php.net/manual/en/language.modifier.strip.tags.php
+ *          strip_tags (Smarty online manual)
+ * @param string
+ * @param boolean
+ * @return string
+ */
+function smarty_modifier_strip_tags($string, $replace_with_space = true)
+{
+    if ($replace_with_space)
+        return preg_replace('!<[^>]*?>!', ' ', $string);
+    else
+        return strip_tags($string);
+}
+
+/* vim: set expandtab: */
+
+?>
This page took 0.095762 seconds and 4 git commands to generate.