daily pastebin goal
52%
SHARE
TWEET

Gerador de CPF

stneiogames Oct 12th, 2011 485 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <html>
  2. <head>
  3. <title>Gerador de CPF!</title>
  4. </head>
  5. <body>
  6. <h1>Gerador de CPFs Randômicos, não necessariamente verdadeiros!</h2>
  7. CPF: <br>
  8. <!--
  9. Script Desenvolvido por Stênio Elson, com base no algorítimo disponibilizado pelo site http://www.geradorcpf.com/
  10. Contato :
  11.     Email: stenio.elson@gmail.com
  12.     facebook: facebook.com/steniogames
  13.     twitter: @steniogames
  14.    
  15. Mantenha os créditos, um dia você criará seu script e gostará que isso aconteça, Obrigado.
  16. -->
  17. <?php
  18.     $num = array();
  19.     $num[9]=$num[10]=$num[11]=0;
  20.     for ($w=0; $w > -2; $w--){
  21.         for($i=$w; $i < 9; $i++){
  22.             $x=($i-10)*-1;
  23.             $w==0?$num[$i]=rand(0,9):'';
  24.             echo ($w==0?$num[$i]:'');
  25.             ($w==-1 && $i==$w && $num[11]==0)?
  26.                 $num[11]+=$num[10]*2    :
  27.                 $num[10-$w]+=$num[$i-$w]*$x;
  28.         }
  29.         $num[10-$w]=(($num[10-$w]%11)<2?0:(11-($num[10-$w]%11)));
  30.         echo $num[10-$w];
  31.     }
  32.     echo '<br>'.$num[0].$num[1].$num[2].'.'.$num[3].$num[4].$num[5].'.'.$num[6].$num[7].$num[8].'-'.$num[10].$num[11];//Colocando separadores
  33. ?>
  34. </body>
  35. </html>
  36.  
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top