Automatically exported from code.google.com/p/planningalerts
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

34 wiersze
742 B

  1. <?php
  2. /**
  3. * Smarty plugin
  4. * @package Smarty
  5. * @subpackage plugins
  6. */
  7. /**
  8. * Smarty strip modifier plugin
  9. *
  10. * Type: modifier<br>
  11. * Name: strip<br>
  12. * Purpose: Replace all repeated spaces, newlines, tabs
  13. * with a single space or supplied replacement string.<br>
  14. * Example: {$var|strip} {$var|strip:"&nbsp;"}
  15. * Date: September 25th, 2002
  16. * @link http://smarty.php.net/manual/en/language.modifier.strip.php
  17. * strip (Smarty online manual)
  18. * @author Monte Ohrt <monte at ohrt dot com>
  19. * @version 1.0
  20. * @param string
  21. * @param string
  22. * @return string
  23. */
  24. function smarty_modifier_strip($text, $replace = ' ')
  25. {
  26. return preg_replace('!\s+!', $replace, $text);
  27. }
  28. /* vim: set expandtab: */
  29. ?>