reference/network/functions/ip2long.xml
184f3f7bd45643cb80f828d0bb001991ec3a5fad
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xml:id="function.ip2long" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="function.ip2long">
4
4
<refnamediv>
5
5
<refname>ip2long</refname>
6
6
<refpurpose>Converts a string containing an (IPv4) Internet Protocol dotted address into a long integer</refpurpose>
...
...
@@ -9,11 +9,11 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>int</type><methodname>ip2long</methodname>
13
-
<methodparam><type>string</type><parameter>ip_address</parameter></methodparam>
12
+
<type class="union"><type>int</type><type>false</type></type><methodname>ip2long</methodname>
13
+
<methodparam><type>string</type><parameter>ip</parameter></methodparam>
14
14
</methodsynopsis>
15
15
<para>
16
-
The function <function>ip2long</function> generates an long integer
16
+
The function <function>ip2long</function> generates a long integer
17
17
representation of IPv4 Internet network address from its Internet
18
18
standard format (dotted string) representation.
19
19
</para>
...
...
@@ -29,7 +29,7 @@
29
29
<para>
30
30
<variablelist>
31
31
<varlistentry>
32
-
<term><parameter>ip_address</parameter></term>
32
+
<term><parameter>ip</parameter></term>
33
33
<listitem>
34
34
<para>
35
35
A standard format address.
...
...
@@ -43,45 +43,11 @@
43
43
<refsect1 role="returnvalues">
44
44
&reftitle.returnvalues;
45
45
<para>
46
-
Returns the long integer or &false; if <parameter>ip_address</parameter>
46
+
Returns the long integer or &false; if <parameter>ip</parameter>
47
47
is invalid.
48
48
</para>
49
49
</refsect1>
50
50

51
-
<refsect1 role="changelog">
52
-
&reftitle.changelog;
53
-
<para>
54
-
<informaltable>
55
-
<tgroup cols="2">
56
-
<thead>
57
-
<row>
58
-
<entry>&Version;</entry>
59
-
<entry>&Description;</entry>
60
-
</row>
61
-
</thead>
62
-
<tbody>
63
-
<row>
64
-
<entry>5.5.0</entry>
65
-
<entry>
66
-
Prior to this version, on Windows <function>ip2long</function> would sometimes return
67
-
a valid number even if passed a value which was not an (IPv4) Internet Protocol
68
-
dotted address.
69
-
</entry>
70
-
</row>
71
-
<row>
72
-
<entry>5.2.10</entry>
73
-
<entry>
74
-
Prior to this version, <function>ip2long</function> would sometimes return
75
-
a valid number even if passed a value which was not an (IPv4) Internet Protocol
76
-
dotted address.
77
-
</entry>
78
-
</row>
79
-
</tbody>
80
-
</tgroup>
81
-
</informaltable>
82
-
</para>
83
-
</refsect1>
84
-

85
51
<refsect1 role="examples">
86
52
&reftitle.examples;
87
53
<para>
...
...
@@ -130,7 +96,7 @@ if ($long == -1 || $long === FALSE) {
130
96
&reftitle.notes;
131
97
<note>
132
98
<para>
133
-
Because PHP's <type>integer</type> type is signed, and many IP addresses
99
+
Because PHP's <type>int</type> type is signed, and many IP addresses
134
100
will result in negative integers on 32-bit architectures, you need to use
135
101
the "%u" formatter of <function>sprintf</function> or
136
102
<function>printf</function> to get the string representation of the
...
...
@@ -139,11 +105,8 @@ if ($long == -1 || $long === FALSE) {
139
105
</note>
140
106
<note>
141
107
<para>
142
-
<function>ip2long</function> will return &false; for the IP
143
-
<literal>255.255.255.255</literal> in PHP 5 &lt;= 5.0.2, and <literal>-1</literal>
144
-
on 64-bits systems in PHP 5 &lt;=5.2.4. It was fixed in
145
-
PHP 5.2.5 where it returns <literal>4294967295</literal>. 32-bit systems
146
-
will return <literal>-1</literal> due to the integer value overflowing.
108
+
<function>ip2long</function> will return <literal>-1</literal> for the IP
109
+
<literal>255.255.255.255</literal> on 32-bit systems due to the integer value overflowing.
147
110
</para>
148
111
</note>
149
112
</refsect1>
...
...
@@ -159,7 +122,6 @@ if ($long == -1 || $long === FALSE) {
159
122
</refsect1>
160
123

161
124
</refentry>
162
-

163
125
<!-- Keep this comment at the end of the file
164
126
Local variables:
165
127
mode: sgml
166
128