PageRenderTime 52ms CodeModel.GetById 31ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/koi/libraries/view/vendor/dwoo/plugins/builtin/functions/strip_tags.php

https://github.com/ngonchan/koi
PHP | 27 lines | 9 code | 1 blank | 17 comment | 2 complexity | 00f8a9e0110f2776ba995394b90299ea MD5 | raw file
  1. <?php
  2. /**
  3. * Removes all html tags
  4. * <pre>
  5. * * value : the string to process
  6. * * addspace : if true, a space is added in place of every removed tag
  7. * </pre>
  8. * This software is provided 'as-is', without any express or implied warranty.
  9. * In no event will the authors be held liable for any damages arising from the use of this software.
  10. *
  11. * @author Jordi Boggiano <j.boggiano@seld.be>
  12. * @copyright Copyright (c) 2008, Jordi Boggiano
  13. * @license http://dwoo.org/LICENSE Modified BSD License
  14. * @link http://dwoo.org/
  15. * @version 1.0.0
  16. * @date 2008-10-23
  17. * @package Dwoo
  18. */
  19. function Dwoo_Plugin_strip_tags_compile(Dwoo_Compiler $compiler, $value, $addspace=true)
  20. {
  21. if ($addspace==='true') {
  22. return "preg_replace('#<[^>]*>#', ' ', $value)";
  23. } else {
  24. return "strip_tags($value)";
  25. }
  26. }