- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
<?php
function generate_number_part($length=2) {
$password = substr(preg_replace("/[^0-9]/", "", crypt(time())) .
preg_replace("/[^0-9]/", "", crypt(time())) .
preg_replace("/[^0-9]/", "", crypt(time())),
0, $length);
return $password;
}