Documented ip2long, long2ip with a simple example

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@29935 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jesus M. Castagnetto 2000-08-09 08:08:14 +00:00
parent 532b86ba1a
commit 862448d51d

View file

@ -575,6 +575,71 @@ if (!fp) {
</refsect1>
</refentry>
<refentry id="function.ip2long">
<refnamediv>
<refname>ip2long</refname>
<refpurpose>
Converts a string containing an (IPv4) Internet Protocol dotted address
into a proper address.
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ip2long</function></funcdef>
<paramdef>string <parameter>ip_address</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
The function <function>ip2long</function> generates an IPv4 Internet
network address from its Internet standard format (dotted string)
representation.
<example>
<title><function>Ip2long</function> Example</title>
<programlisting role="php">
&lt;?
$ip = gethostbyname("www.php.net");
$out = "The following URLs are equivalent:&lt;br&gt;\n";
$out .= "http://www.php.net/, http://".$ip."/, and http://".ip2long($ip)."/&lt;br&gt;\n";
echo $out;
?&gt;
</programlisting>
</example>
</para>
<para>
See also: <function>long2ip</function>
</para>
</refsect1>
</refentry>
<refentry id="function.long2ip">
<refnamediv>
<refname>long2ip</refname>
<refpurpose>
Converts an (IPv4) Internet network address into a string in Internet
standard dotted format
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcprototype>
<funcdef>string <function>long2ip</function></funcdef>
<paramdef>int <parameter>proper_address</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<para>
The function <function>long2ip</function> generates an Interned address
in dotted format (i.e.: aaa.bbb.ccc.ddd) from the proper address
representation.
</para>
<para>
See also: <function>ip2long</function>
</para>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file