Advertisement
Guest User

Untitled

a guest
Jun 6th, 2013
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <?php
  2. /**
  3. * Number manipulation class
  4. *
  5. * This class handles any methods that are used
  6. * to manipulate numbers
  7. *
  8. * @version 1.0
  9. * @package core
  10. * @category class
  11. * @author MY NAME
  12. * @license MIT http://opensource.org/licenses/MIT
  13. */
  14. namespace limber\core;
  15.  
  16. class Num
  17. {
  18. /**
  19. * Random number generator
  20. *
  21. * @param $length int The length of the number required
  22. * @return $num int A random number
  23. * @author Unknown
  24. */
  25. public static function random($length = 8)
  26. {
  27. $characters = "0123456789abcdefghijklmnopqrstuvwxyz";
  28. $num = "";
  29. for ($p = 0; $p < $length; $p++) {
  30. $num .= $characters[mt_rand(0, strlen($characters))];
  31. }
  32. return $num;
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement