Skip to content

Instantly share code, notes, and snippets.

@ajitam
Last active December 21, 2015 21:49
Show Gist options
  • Save ajitam/6371047 to your computer and use it in GitHub Desktop.
Save ajitam/6371047 to your computer and use it in GitHub Desktop.
Need codes which doesn't start with number? Here you go :)
<?php
$time = time();
$codes = array();
while (count($codes) < 5) {
$code = $time*$time;
$code -= rand(0,999999);
$code = sha1($code);
if(!is_numeric(substr($code, 0, 1))){
array_push($codes, $code);
}
}
foreach($codes as $code) {
echo $code . "\n";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment