array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'function.inet-ntop.php', 1 => 'inet_ntop', ), 'up' => array ( 0 => 'ref.network.php', 1 => 'Ağ İşlevleri', ), 'prev' => array ( 0 => 'function.http-response-code.php', 1 => 'http_response_code', ), 'next' => array ( 0 => 'function.inet-pton.php', 1 => 'inet_pton', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'tr', 'path' => 'reference/network/functions/inet-ntop.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.1.0, PHP 7, PHP 8)
inet_ntop — Bir IP adresinin in_addr gösterimini insan okuyabilir gösterime dönüştürür
Bu işlev 32 bitlik IPv4 veya (PHP, IPv6 desteğiyle derenmişse) 128 bitlik IPv6 adresini dizge gösterimli uygun bir adres ailesine dönüştürür.
ip
32 bitlik IPv4 veya 128 bitlik IPv6 adresi
Başarısızlık durumunda false
, aksi takdirde adresin dizge gösterimiyle
döner.
Örnek 1 - inet_ntop() örneği
<?php
$ikil = chr(127) . chr(0) . chr(0) . chr(1);
$dizge = inet_ntop($packed);
/* Çıktısı: 127.0.0.1 */
echo $dizge;
$ikil = str_repeat(chr(0), 15) . chr(1);
$dizge = inet_ntop($packed);
/* Çıktısı: ::1 */
echo $dizge;
?>