Posted By

metoikos on 01/08/10


Tagged

php iban


Versions (?)

Php Iban Check


 / Published in: PHP
 

  1. <?php
  2.  
  3. // CopyLeft javam.org tarafından yayınlanmıştır.
  4.  
  5. function ibanDogrula ($deger) {
  6. $iban = false;
  7. $deger = strtoupper(trim($deger));
  8. if(preg_match('/^TR\d{7}0[A-Z0-9]{16}$/', $deger)) {
  9. $sayi = substr($deger,4,22).'2927'.substr($deger,2,2);
  10. $sayi = str_replace(
  11. array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'),
  12. array(10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35),
  13. $sayi
  14. );
  15. $iban = (1 == bcmod($sayi,97)) ? true:false;
  16. }
  17. return $iban;
  18. }

Report this snippet  

You need to login to post a comment.