<?php header('Content-type: text/html; charset=utf-8'); $client = new SoapClient("https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx?WSDL"); try{ $result = $client->TCKimlikNoDogrula(array( 'TCKimlikNo' => '11111111111','Ad' => 'MEHMET','Soyad' => 'MUTLU','DogumYili' => '1989')); if($result->TCKimlikNoDogrulaResult){ echo 'TC Kimlik Numarası Geçerli'; }else{ echo 'TC Kimlik Numarası Hatalı'; } }catch (Exception $ex){ echo $ex->faultstring; } ?>
Etiket arşivi: Array
convert_smart_quotes
Microsoft World’e ait özel karakterleri temizlemek için,
function convert_smart_quotes($text){ $text = mb_convert_encoding($text, 'HTML-ENTITIES', 'UTF-8'); // UTF-8 karakteleri cevir $text = str_replace( array("\xe2\x80\x98", "\xe2\x80\x99", "\xe2\x80\x9c", "\xe2\x80\x9d", "\xe2\x80\x93", "\xe2\x80\x94", "\xe2\x80\xa6"), array("'", "'", '"', '"', '-', '--', '...'), $text); // Windows-1252 karakterleri cevir $text = str_replace( array(chr(145), chr(146), chr(147), chr(148), chr(150), chr(151), chr(133)), array("'", "'", '"', '"', '-', '--', '...'), $text); // HTML Kod karakterlerini cevir $text = str_replace( array("‘", "’", "“", "”", "–", "—", "…"), array("'", "'", '"', '"', '-', '--', '...'), $text); // Windows-1252 karakterleri cevir $text = str_replace( array("‘", "’", "“", "”", "–", "—", "…"), array("'", "'", '"', '"', '-', '--', '...'), $text); // Turkce karakterleri cevir $text = str_replace( array("Ğ", "ğ", "Ö", "ö", "Ç", "ç", "Ş", "ş", "İ", "ı", "Ü", "ü"), array("Ğ", "ğ", 'Ö', 'ö', 'Ç', 'ç', 'Ş', 'ş', 'İ', 'ı', 'Ü', 'ü'), $text); return $text; }
filter_var
<?php // for filters that accept options, use this format $options = array( 'options' => array( 'default' => 3, // value to return if the filter fails // other options here 'min_range' => 0 ), 'flags' => FILTER_FLAG_ALLOW_OCTAL, ); $var = filter_var('0755', FILTER_VALIDATE_INT, $options); // for filter that only accept flags, you can pass them directly $var = filter_var('oops', FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); // for filter that only accept flags, you can also pass as an array $var = filter_var('oops', FILTER_VALIDATE_BOOLEAN, array('flags' => FILTER_NULL_ON_FAILURE)); // callback filter function foo($value) { $ret = new stdClass; $ret->value = filter_var($value, FILTER_VALIDATE_BOOLEAN, array('flags' => FILTER_NULL_ON_FAILURE)); return $ret; } $var = filter_var('yes', FILTER_CALLBACK, array('options' => 'foo')); ?>
http_build_query
<?php $data = array('foo', 'bar', 'baz', 'boom', 'cow' => 'milk', 'php' =>'hypertext processor'); echo http_build_query($data) . "\n"; echo http_build_query($data, 'myvar_'); ?>
<?php $data = array('foo'=>'bar', 'baz'=>'boom', 'cow'=>'milk', 'php'=>'hypertext processor'); echo http_build_query($data); // foo=bar&baz=boom&cow=milk&php=hypertext+processor echo http_build_query($data, '', '&'); // foo=bar&baz=boom&cow=milk&php=hypertext+processor ?>0=foo&1=bar&2=baz&3=boom&cow=milk&php=hypertext+processor myvar_0=foo&myvar_1=bar&myvar_2=baz&myvar_3=boom&cow=milk&php=hypertext+processor
Plesk Api domain bilgilerini çekmek
<?php function get($host, $login, $password, $packet){ $curl = curl_init(); curl_setopt($curl,CURLOPT_URL, "https://{$host}:8443/enterprise/control/agent.php"); curl_setopt($curl,CURLOPT_RETURNTRANSFER,true); curl_setopt($curl,CURLOPT_POST,true); curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false); curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,false); curl_setopt($curl,CURLOPT_HTTPHEADER,array("HTTP_AUTH_LOGIN: {$login}","HTTP_AUTH_PASSWD: {$password}","HTTP_PRETTY_PRINT: TRUE","Content-Type: text/xml")); curl_setopt($curl,CURLOPT_POSTFIELDS,$packet); $result = curl_exec($curl); $xml = new SimpleXMLElement($result); if (curl_errno($curl)){ $errmsg = curl_error($curl); $errcode = curl_errno($curl); curl_close($curl); throw new ApiRequestException($errmsg, $errcode); } curl_close($curl); return $xml; } function domain_get($host, $login, $password,$domain){ $packet = '<packet version="1.6.0.0"><domain><get><filter><domain-name>'.$domain.'</domain-name></filter><dataset><hosting/><limits/><stat/></dataset></get></domain></packet>'; return $this->get($host, $login, $password,$packet); } print_r(domain_get('12.12.12.12','admin','123456','test.com')); ?>