<?php

require_once($_SERVER['DOCUMENT_ROOT'].'db.php');

$iban =     $_GET["iban"]; 
$iban = strtolower(str_replace(' ','',$iban));

$blzfromiban=  substr ($iban,4,8);
$blzfromiban = preg_replace('![^0-9]!', '', $blzfromiban); 

$mydb = new DB_MySQL();
$mydb->query("SELECT * FROM `VerwaltungBankdaten` WHERE `blz` = '$blzfromiban' ");
$row = $mydb->fetchRow();
$bic = utf8_encode($row['kurzbezeichnung']);        
$mydb->disconnect(); 

echo $bic;


?>