Loading:


    Sprawdzanie Peselu

    Skrypt sprawdzania peselu by sobak 



    Napisz Artyku³

    Listing

    function is_valid_pesel($pesel) {
        $a = substr($pesel, 0, 1);
        $b = substr($pesel, 1, 1);
        $c = substr($pesel, 2, 1);
        $d = substr($pesel, 3, 1);
        $e = substr($pesel, 4, 1);
        $f = substr($pesel, 5, 1);
        $g = substr($pesel, 6, 1);
        $h = substr($pesel, 7, 1);
        $i = substr($pesel, 8, 1);
        $j = substr($pesel, 9, 1);
        $checksum = substr($pesel, 10, 1);
       
        $result = $a + 3*$b + 7*$c + 9*$d + $e + 3*$f + 7*$g + 9*$h + $i + 3*$j;
       
        $check = 10 - substr($result, -1, 1);
       
        if (substr($result, -1, 1) == 0)
            $check = 0;
       
        if ($check == $checksum)
            return true;
           
        else
            return false;
    }




    Dodano przez: klimbek Ranga: 0 Punktów: 0
    Komentarze użytkowników
      • Tre¶æ komentarza
        Kod do komentarza (opcjonalnie)
        PHP JavaScript MySQL Smarty SQL HTML CSS ActionScript
        Autor
        Token
        token

         

         








    funkcje.net
    Wszelkie prawa zastrzeżone©. | Funkcje.net 2008-2025 v.1.5 | design: diviXdesign & rainbowcolors