mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-26 22:08:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@165615 c90b9560-bf6c-de11-be94-00142212c4b1
68 lines
1.7 KiB
XML
68 lines
1.7 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.2 $ -->
|
|
<refentry id="function.inet-ntop">
|
|
<refnamediv>
|
|
<refname>inet_ntop</refname>
|
|
<refpurpose>
|
|
Converts a packed internet address to a human readable representation
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>inet_ntop</methodname>
|
|
<methodparam><type>string</type><parameter>in_addr</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<simpara>
|
|
This function converts a 32bit IPv4, or 128bit IPv6 address (if PHP
|
|
was built with IPv6 support enabled) into an address family appropriate
|
|
string representation. Returns &false; on failure.
|
|
</simpara>
|
|
<example>
|
|
<title><function>inet_ntop</function> Example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$packed = chr(127) . chr(0) . chr(0) . chr(1);
|
|
$expanded = inet_pton($packed);
|
|
|
|
/* Outputs: 127.0.0.1 */
|
|
echo $expanded;
|
|
|
|
$packed = str_repeat(chr(0), 15) . chr(1);
|
|
$expanded = inet_pton($packed);
|
|
|
|
/* Outputs: ::1 */
|
|
echo $expanded;
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
<para>
|
|
See also <function>long2ip</function>,
|
|
<function>inet_pton</function>, and
|
|
<function>ip2long</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|