PageRenderTime 44ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/framework/vendor/smarty3/lib/libs/plugins/modifier.strip_tags.php

http://zoop.googlecode.com/
PHP | 31 lines | 10 code | 2 blank | 19 comment | 2 complexity | 59d81614c4f22adecbd5966ca0e75cdb MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1
  1. <?php
  2. /**
  3. * Smarty plugin
  4. *
  5. * @package Smarty
  6. * @subpackage PluginsModifier
  7. */
  8. /**
  9. * Smarty strip_tags modifier plugin
  10. *
  11. * Type: modifier<br>
  12. * Name: strip_tags<br>
  13. * Purpose: strip html tags from text
  14. *
  15. * @link http://smarty.php.net/manual/en/language.modifier.strip.tags.php strip_tags (Smarty online manual)
  16. * @author Monte Ohrt <monte at ohrt dot com>
  17. * @param string $
  18. * @param boolean $
  19. * @return string
  20. */
  21. function smarty_modifier_strip_tags($string, $replace_with_space = true)
  22. {
  23. if ($replace_with_space) {
  24. return preg_replace('!<[^>]*?>!', ' ', $string);
  25. } else {
  26. return strip_tags($string);
  27. }
  28. }
  29. ?>