I'm working on adding examples to the is_* functions. Please find some patches attached.
Comments please. In particular, is my commenting of the sceintific notation used apropriate. paul -- Paul Reinheimer Zend Certified Engineer
? is_stuff.diff.txt Index: is-float.xml =================================================================== RCS file: /repository/phpdoc/en/reference/var/functions/is-float.xml,v retrieving revision 1.5 diff -u -r1.5 is-float.xml --- is-float.xml 20 Jun 2007 22:25:34 -0000 1.5 +++ is-float.xml 16 Sep 2007 21:01:23 -0000 @@ -3,7 +3,7 @@ <refentry xml:id="function.is-float" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>is_float</refname> - <refpurpose>Finds whether a variable is a float</refpurpose> + <refpurpose>Finds whether the type of a variable is float</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -12,7 +12,7 @@ <methodparam><type>mixed</type><parameter>var</parameter></methodparam> </methodsynopsis> <para> - Finds whether the given variable is a float. + Finds whether the type of the given variable is float. </para> <note> <para> @@ -44,6 +44,43 @@ &false; otherwise. </para> </refsect1> + <refsect1 role="is-float.examples"> + &reftitle.examples; + <para> + <example> + <title><function>is_float</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +if(is_float(27.25)) +{ + echo "is float\n"; +}else { + echo "is not float\n"; +} +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> + <refsect1 role="seealso"> &reftitle.seealso; <para> Index: is-int.xml =================================================================== RCS file: /repository/phpdoc/en/reference/var/functions/is-int.xml,v retrieving revision 1.6 diff -u -r1.6 is-int.xml --- is-int.xml 13 Sep 2007 18:11:20 -0000 1.6 +++ is-int.xml 16 Sep 2007 21:01:23 -0000 @@ -53,11 +53,10 @@ <programlisting role="php"> <![CDATA[ <?php -if(is_int(23)) +if (is_int(23)) { echo "is integer\n"; -}else -{ +} else { echo "is not an integer\n"; } var_dump(is_int(23)); @@ -67,7 +66,7 @@ ?> ]]> </programlisting> - &example.outputs.similar; + &example.outputs; <screen> <![CDATA[ is integer Index: is-string.xml =================================================================== RCS file: /repository/phpdoc/en/reference/var/functions/is-string.xml,v retrieving revision 1.6 diff -u -r1.6 is-string.xml --- is-string.xml 20 Jun 2007 22:25:34 -0000 1.6 +++ is-string.xml 16 Sep 2007 21:01:23 -0000 @@ -3,7 +3,7 @@ <refentry xml:id="function.is-string" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>is_string</refname> - <refpurpose>Finds whether a variable is a string</refpurpose> + <refpurpose>Find whether the type of a variable is string</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; @@ -12,7 +12,7 @@ <methodparam><type>mixed</type><parameter>var</parameter></methodparam> </methodsynopsis> <para> - Finds whether the given variable is a string. + Finds whether the type given variable is string. </para> </refsect1> <refsect1 role="parameters"> @@ -33,10 +33,45 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Returns &true; if <parameter>var</parameter> is a <type>string</type>, + Returns &true; if <parameter>var</parameter> is of type <type>string</type>, &false; otherwise. </para> </refsect1> + <refsect1 role="is-string.examples"> + &reftitle.examples; + <para> + <example> + <title><function>is_string</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +if (is_string(23)) +{ + echo "is string\n"; +} else { + echo "is not an string\n"; +} +var_dump(is_string('abc')); +var_dump(is_string("23")); +var_dump(is_string(23.5)); +var_dump(is_string(true)); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +is string +bool(true) +bool(true) +bool(false) +bool(false) +]]> + </screen> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para>