PageRenderTime 36ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/secured/phpDocumentor/phpDocumentor/Smarty-2.6.0/libs/plugins/modifier.strip_tags.php

http://oregon-caspages.googlecode.com/
PHP | 31 lines | 9 code | 4 blank | 18 comment | 1 complexity | 3c86635ff4bfc05166eefee8510edbb6 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, AGPL-3.0
  1. <?php
  2. /**
  3. * Smarty plugin
  4. * @package Smarty
  5. * @subpackage plugins
  6. */
  7. /**
  8. * Smarty strip_tags modifier plugin
  9. *
  10. * Type: modifier<br>
  11. * Name: strip_tags<br>
  12. * Purpose: strip html tags from text
  13. * @link http://smarty.php.net/manual/en/language.modifier.strip.tags.php
  14. * strip_tags (Smarty online manual)
  15. * @param string
  16. * @param boolean
  17. * @return string
  18. */
  19. function smarty_modifier_strip_tags($string, $replace_with_space = true)
  20. {
  21. if ($replace_with_space)
  22. return preg_replace('!<[^>]*?>!', ' ', $string);
  23. else
  24. return strip_tags($string);
  25. }
  26. /* vim: set expandtab: */
  27. ?>