narcoPX
Üye
<?php
function cozumleIBAN($iban) {
$post = "iban=$iban&x=91&y=17";
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => "https://hesapno.com/cozumle_iban",
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => $post,
));
$response = curl_exec($ch);
if ($response === false) {
die('CURL Hatası: ' . curl_error($ch));
}
curl_close($ch);
$data = array(
'success' => true,
'author' => '@narcoPX',
);
$patterns = array(
'Ad' => '/<b>Ad:<\/b>\s*([^<]*)/',
'Kod' => '/<b>Kod:<\/b>\s*([^<]*)/',
'Swift' => '/<b>Swift:<\/b>\s*([^<]*)/',
'Hesap No' => '/<b>Hesap No:<\/b>\s*([^<]*)/',
'İl' => '/<b>İl:<\/b>\s*([^<]*)/',
'İlçe' => '/<b>İlçe:<\/b>\s*([^<]*)/',
'Tel' => '/<b>Tel:<\/b>\s*([^<]*)/',
'Fax' => '/<b>Fax:<\/b>\s*([^<]*)/',
'Adres' => '/<b>Adres:<\/b>\s*([^<]*)/',
);
foreach ($patterns as $key => $pattern) {
preg_match($pattern, $response, $matches);
$data[$key] = isset($matches[1]) ? trim($matches[1]) : '';
}
return json_encode($data, JSON_UNESCAPED_UNICODE);
}
// Kullanım örneği
$iban = $_GET['iban'];
$result = cozumleIBAN($iban);
// Sonuçları kontrol et
if ($result === '{"success":true,"author":"@narcoPX","Ad":"","Kod":"","Swift":"","Hesap No":"","İl":"","İlçe":"","Tel":"","Fax":"","Adres":""}') {
echo "Sonuç bulunamadı!";
} else {
echo $result;
}
?>
function cozumleIBAN($iban) {
$post = "iban=$iban&x=91&y=17";
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => "https://hesapno.com/cozumle_iban",
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => $post,
));
$response = curl_exec($ch);
if ($response === false) {
die('CURL Hatası: ' . curl_error($ch));
}
curl_close($ch);
$data = array(
'success' => true,
'author' => '@narcoPX',
);
$patterns = array(
'Ad' => '/<b>Ad:<\/b>\s*([^<]*)/',
'Kod' => '/<b>Kod:<\/b>\s*([^<]*)/',
'Swift' => '/<b>Swift:<\/b>\s*([^<]*)/',
'Hesap No' => '/<b>Hesap No:<\/b>\s*([^<]*)/',
'İl' => '/<b>İl:<\/b>\s*([^<]*)/',
'İlçe' => '/<b>İlçe:<\/b>\s*([^<]*)/',
'Tel' => '/<b>Tel:<\/b>\s*([^<]*)/',
'Fax' => '/<b>Fax:<\/b>\s*([^<]*)/',
'Adres' => '/<b>Adres:<\/b>\s*([^<]*)/',
);
foreach ($patterns as $key => $pattern) {
preg_match($pattern, $response, $matches);
$data[$key] = isset($matches[1]) ? trim($matches[1]) : '';
}
return json_encode($data, JSON_UNESCAPED_UNICODE);
}
// Kullanım örneği
$iban = $_GET['iban'];
$result = cozumleIBAN($iban);
// Sonuçları kontrol et
if ($result === '{"success":true,"author":"@narcoPX","Ad":"","Kod":"","Swift":"","Hesap No":"","İl":"","İlçe":"","Tel":"","Fax":"","Adres":""}') {
echo "Sonuç bulunamadı!";
} else {
echo $result;
}
?>