Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Test to see MarketPress order number generator generates numbers who is only digits.
- // Save in a file and run in terminal.
- $count = 10000;
- $nums = 0;
- for ($i = 0; $i < $count; $i++) {
- $order_id = substr( sha1( uniqid( '' ) ), rand( 1, 24 ), 12 );
- if (is_numeric($order_id)) {
- echo "\n".$order_id."\n";
- $nums ++;
- } else {
- echo ".";
- }
- }
- $pro = $nums * 100 / $count ;
- echo "\n $nums Order-ids numeric out of $count => $pro %\n";
- /*
- Output (Last lines):
- 735794351019
- .....................................................
- 142417955337
- ..........................................................................
- 680235e21764
- .........................................
- 68 Order-ids numeric out of 10000 => 0.68 %
- */
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement