php-doc-en/reference/network/functions/inet-pton.xml
2011-04-11 11:09:29 +00:00

122 lines
2.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.inet-pton" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>inet_pton</refname>
<refpurpose>Converts a human readable IP address to its packed in_addr representation</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>inet_pton</methodname>
<methodparam><type>string</type><parameter>address</parameter></methodparam>
</methodsynopsis>
<para>
This function converts a human readable IPv4 or IPv6 address (if PHP
was built with IPv6 support enabled) into an address family appropriate
32bit or 128bit binary structure.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>address</parameter></term>
<listitem>
<para>
A human readable IPv4 or IPv6 address.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the <literal>in_addr</literal> representation of the given
<parameter>address</parameter>, or &false; if a syntactically invalid
<parameter>address</parameter> is given (for example, an IPv4 address
without dots or an IPv6 address without colons).
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>inet_pton</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php
$in_addr = inet_pton('127.0.0.1');
$in6_addr = inet_pton('::1');
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.3.0</entry>
<entry>
This function is now available on Windows platforms.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ip2long</function></member>
<member><function>long2ip</function></member>
<member><function>inet_ntop</function></member>
</simplelist>
</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:"~/.phpdoc/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
-->