Advertisement
Guest User

Untitled

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