2010-03-28 22:10:10 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 09:15:58 +00:00
|
|
|
<!-- $Revision$ -->
|
2011-08-16 07:57:19 +00:00
|
|
|
<refentry xml:id="function.is-float" xmlns="http://docbook.org/ns/docbook">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>is_float</refname>
|
|
|
|
<refpurpose>Finds whether the type of a variable is float</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>bool</type><methodname>is_float</methodname>
|
|
|
|
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
|
|
Finds whether the type of the given variable is float.
|
|
|
|
</para>
|
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
To test if a variable is a number or a numeric string (such as form
|
|
|
|
input, which is always a string), you must use
|
|
|
|
<function>is_numeric</function>.
|
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>var</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The variable being evaluated.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
Returns &true; if <parameter>var</parameter> is a <type>float</type>,
|
|
|
|
&false; otherwise.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
|
|
|
<para>
|
2007-09-20 14:53:34 +00:00
|
|
|
<example>
|
|
|
|
<title><function>is_float</function> example</title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
2010-04-04 20:03:29 +00:00
|
|
|
if (is_float(27.25)) {
|
|
|
|
echo "is float\n";
|
|
|
|
} else {
|
|
|
|
echo "is not float\n";
|
2007-09-20 14:53:34 +00:00
|
|
|
}
|
|
|
|
var_dump(is_float('abc'));
|
|
|
|
var_dump(is_float(23));
|
|
|
|
var_dump(is_float(23.5));
|
|
|
|
var_dump(is_float(1e7)); //Scientific Notation
|
|
|
|
var_dump(is_float(true));
|
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
&example.outputs;
|
|
|
|
<screen>
|
|
|
|
<![CDATA[
|
|
|
|
is float
|
|
|
|
bool(false)
|
|
|
|
bool(false)
|
|
|
|
bool(true)
|
|
|
|
bool(true)
|
|
|
|
bool(false)
|
|
|
|
]]>
|
|
|
|
</screen>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2011-08-16 07:57:19 +00:00
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
|
|
|
<para>
|
|
|
|
<simplelist>
|
|
|
|
<member><function>is_bool</function></member>
|
|
|
|
<member><function>is_int</function></member>
|
|
|
|
<member><function>is_numeric</function></member>
|
|
|
|
<member><function>is_string</function></member>
|
|
|
|
<member><function>is_array</function></member>
|
|
|
|
<member><function>is_object</function></member>
|
|
|
|
</simplelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
|
|
|
<!-- 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
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2002-04-15 00:12:54 +00:00
|
|
|
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
|
|
|
|
-->
|