Created
April 20, 2018 13:57
-
-
Save leonirlopes/e7944585c36d4483fa30ee4e48be77d2 to your computer and use it in GitHub Desktop.
Senha do Dia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// veja em funcionamento ~~> https://ideone.com/IMDNHT | |
// defino a data de hoje | |
$ano = date('Y'); | |
$mes = date('m'); | |
$dia = date('d'); | |
// calculo uma senha de 6 digítos com base na data | |
$senha = substr((substr($ano, -2) * $mes * $dia * ($ano - 1900) * 6666), -6); | |
echo $senha; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment