No Description
unmaintained
experiment
php

functions.php 825B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * PHPLib
  4. *
  5. * A PHP library to wrap php functions in a standard fashion
  6. *
  7. * @package PHPLib
  8. * @author Timothy J. Warren
  9. * @copyright Copyright (c) 2013
  10. * @link https://github.com/aviat4ion/PHPLib
  11. * @license MIT
  12. */
  13. // --------------------------------------------------------------------------
  14. /**
  15. * Access function for string methods
  16. *
  17. * @param string $str
  18. * @return object
  19. */
  20. function str($str)
  21. {
  22. static $str_obj;
  23. if ( ! isset($str_obj))
  24. {
  25. $str_obj = new \PHPUtil\Str('');
  26. }
  27. $str_obj->__construct($str);
  28. return $str_obj;
  29. }
  30. /**
  31. * Access function for array methods
  32. *
  33. * @param array $array
  34. * @return object
  35. */
  36. function arr(array $array)
  37. {
  38. static $arr_obj;
  39. if ( ! isset($arr_obj))
  40. {
  41. $arr_obj = new \PHPUtil\Arr(array());
  42. }
  43. $arr_obj->__construct($arr);
  44. return $arr_obj;
  45. }