reference/var/functions/is-resource.xml
77887dc8e5ee9e840f0ed440431c70259fcc5661
...
...
@@ -13,10 +13,10 @@
13
13
&reftitle.description;
14
14
<methodsynopsis>
15
15
<type>bool</type><methodname>is_resource</methodname>
16
-
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
16
+
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
17
17
</methodsynopsis>
18
18
<para>
19
-
Finds whether the given variable is a resource.
19
+
Finds whether the given variable is a <type>resource</type>.
20
20
</para>
21
21
</refsect1>
22
22

...
...
@@ -25,7 +25,7 @@
25
25
<para>
26
26
<variablelist>
27
27
<varlistentry>
28
-
<term><parameter>var</parameter></term>
28
+
<term><parameter>value</parameter></term>
29
29
<listitem>
30
30
<para>
31
31
The variable being evaluated.
...
...
@@ -39,7 +39,7 @@
39
39
<refsect1 role="returnvalues">
40
40
&reftitle.returnvalues;
41
41
<para>
42
-
Returns &true; if <parameter>var</parameter> is a <type>resource</type>,
42
+
Returns &true; if <parameter>value</parameter> is a <type>resource</type>,
43
43
&false; otherwise.
44
44
</para>
45
45
</refsect1>
...
...
@@ -53,14 +53,20 @@
53
53
<![CDATA[
54
54
<?php
55
55

56
-
$db_link = @mysql_connect('localhost', 'mysql_user', 'mysql_pass');
57
-
if (!is_resource($db_link)) {
58
-
die('Can\'t connect : ' . mysql_error());
56
+
$handle = fopen("php://stdout", "w");
57
+
if (is_resource($handle)) {
58
+
echo '$handle is a resource';
59
59
}
60
60

61
61
?>
62
62
]]>
63
63
</programlisting>
64
+
&example.outputs;
65
+
<screen role="php">
66
+
<![CDATA[
67
+
$handle is a resource
68
+
]]>
69
+
</screen>
64
70
</example>
65
71
</para>
66
72
</refsect1>
...
...
@@ -69,7 +75,7 @@ if (!is_resource($db_link)) {
69
75
&reftitle.notes;
70
76
<note>
71
77
<para>
72
-
<function>is_resource</function> is not a strict type-checking method: it will return &false; if <parameter>var</parameter> is a resource variable that has been closed.
78
+
<function>is_resource</function> is not a strict type-checking method: it will return &false; if <parameter>value</parameter> is a resource variable that has been closed.
73
79
</para>
74
80
</note>
75
81
</refsect1>
...
...
@@ -84,7 +90,6 @@ if (!is_resource($db_link)) {
84
90
</para>
85
91
</refsect1>
86
92
</refentry>
87
-

88
93
<!-- Keep this comment at the end of the file
89
94
Local variables:
90
95
mode: sgml
91
96