Digits.php 647 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. *
  4. * PHP Pro Bid $Id$ IhS0obfuyVroCfh4+I48qXA/qqiB9Uq2WgEUR41GqlE=
  5. *
  6. * @link http://www.phpprobid.com
  7. * @copyright Copyright (c) 2017 Online Ventures Software & CodeCube SRL
  8. * @license http://www.phpprobid.com/license Commercial License
  9. *
  10. * @version 1.9 [rev.1.9.01]
  11. */
  12. /**
  13. * digits filter
  14. */
  15. namespace Cube\Filter;
  16. class Digits extends AbstractFilter
  17. {
  18. /**
  19. *
  20. * replace a string with its integer value
  21. *
  22. * @param string $value
  23. *
  24. * @return string
  25. */
  26. public function filter($value)
  27. {
  28. $value = abs(intval($value));
  29. return (string)$value;
  30. }
  31. }