php-doc-en/reference/var/functions/is-resource.xml
Mehdi Achour 84975fd4f6 adding example
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@138316 c90b9560-bf6c-de11-be94-00142212c4b1
2003-08-20 08:54:57 +00:00

65 lines
1.7 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/var.xml, last change in rev 1.19 -->
<refentry id="function.is-resource">
<refnamediv>
<refname>is_resource</refname>
<refpurpose>
Finds whether a variable is a resource
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>is_resource</methodname>
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
</methodsynopsis>
<para>
<function>is_resource</function> returns &true; if the variable
given by the <parameter>var</parameter> parameter is a
<type>resource</type>, otherwise it returns &false;.
</para>
<para>
<example>
<title>using <function>is_resource</function></title>
<programlisting role="php">
<![CDATA[
<?php
$db_link = @mysql_connect('localhost', 'mysql_user', 'mysql_pass');
if (!is_resource($db_link)) {
die('Can\'t connect : ' . mysql_error());
}
?>
]]>
</programlisting>
</example>
</para>
<para>
See the documentation on the <type>resource</type>-type for
more information.
</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
-->