PHP’de Rastgele Şifre Üretme

<?php

function rastgeleparola() {
  $sozluk = "abchefghjkmnpqrstuvwxyz0123456789";
  srand((double)microtime()*1000000);
      $i = 0;
      while ($i <= 7) {
            $num = rand() % 33;
            $tmp = substr($sozluk, $num, 1);
            $pass = $pass . $tmp;
            $i++;
      }
      return $pass;
}

$parola_yap = rastgeleparola();

echo ("<center><b>$parola_yap</b></center>");
?>

Be the first to comment

Leave a Reply

Your email address will not be published.


*