php-doc-en/reference/var/functions/is-bool.xml
Philip Olson 5748a4eb77 bool -> boolean, and added an example
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@117356 c90b9560-bf6c-de11-be94-00142212c4b1
2003-02-20 16:51:17 +00:00

75 lines
1.8 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/var.xml, last change in rev 1.19 -->
<refentry id="function.is-bool">
<refnamediv>
<refname>is_bool</refname>
<refpurpose>
Finds out whether a variable is a boolean
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>bool</type><methodname>is_bool</methodname>
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
</methodsynopsis>
<para>
Returns &true; if the <parameter>var</parameter> parameter is
a <type>boolean</type>.
</para>
<para>
<example>
<title><function>is_bool</function> examples</title>
<programlisting role="php">
<![CDATA[
<?php
$a = false;
$b = 0;
// Since $a is a boolean, this is true
if (is_bool($a)) {
print "Yes, this is a boolean";
}
// Since $b is not a boolean, this is not true
if (is_bool($b)) {
print "Yes, this is a boolean";
}
?>
]]>
</programlisting>
</example>
</para>
<para>
See also
<function>is_array</function>,
<function>is_float</function>,
<function>is_int</function>,
<function>is_integer</function>,
<function>is_string</function>, and
<function>is_object</function>.
</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
-->