lookjapan.COM - IRC ve mIRC dünyasının forumu!

lookjapan.COM - IRC ve mIRC dünyasının forumu! (http://www.lookjapan.com/index.php)
-   PHP (http://www.lookjapan.com/forumdisplay.php?f=137)
-   -   Php ile Tc Kimlik Numarası Kontrolü Yapmak (http://www.lookjapan.com/showthread.php?t=4008)

Vesaire 31 Ağustos 2016 14:10

Php ile Tc Kimlik Numarası Kontrolü Yapmak
 
PHP- Kodu:

<?php
 
function tckimlik($tckimlik){
 
$olmaz=array('11111111110','22222222220','33333333330','44444444440','55555555550','66666666660','7777777770','88888888880','99999999990');
 if(
$tckimlik[0]==or !ctype_digit($tckimlik) or strlen($tckimlik)!=11){ return false;  }
 else{
 for(
$a=0;$a<9;$a=$a+2){ $ilkt=$ilkt+$tckimlik[$a]; }
 for(
$a=1;$a<9;$a=$a+2){ $sont=$sont+$tckimlik[$a]; }
 for(
$a=0;$a<10;$a=$a+1){ $tumt=$tumt+$tckimlik[$a]; }
 if((
$ilkt*7-$sont)%10!=$tckimlik[9] or $tumt%10!=$tckimlik[10]){ return false; }
 else{
 foreach(
$olmaz as $olurmu){ if($tckimlik==$olurmu){ return false; } }
 return 
true;
 }
 }
 }
 if(
tckimlik('11111111110')){ echo 'Tc Kimlik Numarası doğru!'; } else { echo 'Lütfen geçerli bir Tc Kimlik Numarası giriniz...'; }
 
?>



All times are GMT +3. The time now is 05:40.

Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.