Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * FILE DOCBLOCK
- */
- /*
- * NAME SPACE DOCBLOCK
- */
- namespace limber\core;
- /**
- * Number manipulation class
- *
- * This class handles any methods that are used
- * to manipulate numbers
- *
- * @version 1.0
- * @package core
- * @category class
- * @author MY NAME
- * @license MIT http://opensource.org/licenses/MIT
- */
- class Num
- {
- /**
- * Random number generator
- *
- * @param $length int The length of the number required
- * @return $num int A random number
- * @author Unknown
- */
- public static function random($length = 8)
- {
- $characters = "0123456789abcdefghijklmnopqrstuvwxyz";
- $num = "";
- for ($p = 0; $p < $length; $p++) {
- $num .= $characters[mt_rand(0, strlen($characters))];
- }
- return $num;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement