In this example I will show how to generate random 10 digit numbers in PHP.
Click the PHP Examples link to view other examples created with PHP.
PHP Code:
1 2 3 4 5 6 7 8 9 |
<?php function generateRandomNumber($digit){ return substr(str_shuffle(str_repeat($x='0123456789',$digit)),0,$digit); } echo generateRandomNumber(10); #10 digit ?> |
Output:
1 2 3 |
2996434637 |