PHP Archiv

Das PHP Script Verzeichnis

Werbung

Tag Archives: Iban

Diese PHP Funktion validiert einen Iban Code function ValidIban($value) { $iban = false; $value= strtoupper(trim($value)); # Change US text into your country code if(preg_match(‚/^USd{7}0[A-Z0-9]{16}$/‘, $value)) { $number= substr($value,4,22).’2927′.substr($value,2,2); $number= str_replace( 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‘), 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), $number ); // Iban var – $iban = (1 == bcmod($number,97)) ? true:false; } // Return to print return $iban; }[/php] Quelle: phpsnips.com

Diese Funktion dient der Validierung eines Iban Codes function ValidIban($value) { $iban = false; $value= strtoupper(trim($value)); # Change US text into your country code if(preg_match(‚/^USd{7}0[A-Z0-9]{16}$/‘, $value)) { $number= substr($value,4,22).’2927′.substr($value,2,2); $number= str_replace( 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‘), 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), $number ); // Iban var – $iban = (1 == bcmod($number,97)) ? true:false; } // Return to print return $iban; }[/php] Quelle: […]