Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
PHP TC Kimlik Numarası Doğrulama
function tcno_dogrula($bilgiler){
$gonder = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="" xmlns:xsd="" xmlns:soap="">
<TCKimlikNoDogrula xmlns="">
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "" );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_POST, true );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $gonder);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'POST /Service/KPSPublic.asmx HTTP/1.1',
'Content-Type: text/xml; charset=utf-8',
'SOAPAction: ""',
'Content-Length: '.strlen($gonder)
$gelen = curl_exec($ch);
return strip_tags($gelen);
$bilgiler = array(
"isim" => "SAVAŞ DERSİM", // Isım büyük harflerle yazılmak zorunda
"soyisim" => "ÇELİK", // Soyisim Buyuk harflerle yazılmak zorunda
"dogumyili" => "xxxx",
"tcno" => "xxxxx"
$sonuc = tcno_dogrula($bilgiler);
echo "Doğrulama başarılı";
echo "Doğrulama başarısız";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment