cvs: phpdoc /en/reference/strings/functions md5-file.xml /en/reference/var/functions is-numeric.xml strval.xml

From: Date: Tue, 07 Oct 2008 07:31:12 +0000
Subject: cvs: phpdoc /en/reference/strings/functions md5-file.xml /en/reference/var/functions is-numeric.xml strval.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-2205@lists.php.net to get a copy of this message
kalle Tue Oct 7 07:31:12 2008 UTC Modified files: /phpdoc/en/reference/strings/functions md5-file.xml /phpdoc/en/reference/var/functions is-numeric.xml strval.xml Log: New examples for - md5_file - is_numeric - strval http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/strings/functions/md5-file.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc/en/reference/strings/functions/md5-file.xml diff -u phpdoc/en/reference/strings/functions/md5-file.xml:1.9 phpdoc/en/reference/strings/functions/md5-file.xml:1.10 --- phpdoc/en/reference/strings/functions/md5-file.xml:1.9 Wed Jun 20 22:25:29 2007 +++ phpdoc/en/reference/strings/functions/md5-file.xml Tue Oct 7 07:31:12 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> +<!-- $Revision: 1.10 $ --> <!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 --> <refentry xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://docbook.org/ns/docbook" xml:id="function.md5-file"> <refnamediv> @@ -85,6 +85,23 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Usage example of <function>md5_file</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$file = 'php-5.3.0alpha2-Win32-VC9-x64.zip'; + +echo 'MD5 file hash of ' . $file . ': ' . md5_file($file); +?> +]]> + </programlisting> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/var/functions/is-numeric.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/var/functions/is-numeric.xml diff -u phpdoc/en/reference/var/functions/is-numeric.xml:1.6 phpdoc/en/reference/var/functions/is-numeric.xml:1.7 --- phpdoc/en/reference/var/functions/is-numeric.xml:1.6 Wed Jun 20 22:25:34 2007 +++ phpdoc/en/reference/var/functions/is-numeric.xml Tue Oct 7 07:31:12 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry xml:id="function.is-numeric" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>is_numeric</refname> @@ -7,6 +7,7 @@ Finds whether a variable is a number or a numeric string </refpurpose> </refnamediv> + <refsect1 role="description"> &reftitle.description; <methodsynopsis> @@ -21,6 +22,7 @@ only without sign, decimal and exponential part. </para> </refsect1> + <refsect1 role="parameters"> &reftitle.parameters; <para> @@ -36,6 +38,7 @@ </variablelist> </para> </refsect1> + <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> @@ -43,6 +46,42 @@ string, &false; otherwise. </para> </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>is_numeric</function> examples</title> + <programlisting role="php"> +<![CDATA[ +<?php +$tests = Array( + "42", + 1337, + "1e4", + "not numeric", + Array(), + 9.1 + ); + +foreach($tests as $element) +{ + if(is_numeric($element)) + { + echo "'{$element}' is numeric", PHP_EOL; + } + else + { + echo "'{$element}' is NOT numeric", PHP_EOL; + } +} +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para> @@ -58,6 +97,7 @@ </simplelist> </para> </refsect1> + </refentry> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/var/functions/strval.xml?r1=1.6&r2=1.7&diff_format=u Index: phpdoc/en/reference/var/functions/strval.xml diff -u phpdoc/en/reference/var/functions/strval.xml:1.6 phpdoc/en/reference/var/functions/strval.xml:1.7 --- phpdoc/en/reference/var/functions/strval.xml:1.6 Thu Feb 21 01:28:41 2008 +++ phpdoc/en/reference/var/functions/strval.xml Tue Oct 7 07:31:12 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <refentry xml:id="function.strval" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>strval</refname> @@ -46,6 +46,31 @@ </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>strval</function> example using PHP5's magic __toString method</title> + <programlisting role="php"> +<![CDATA[ +<?php +class StrValTest +{ + public function __toString() + { + return __CLASS__; + } +} + +// Prints 'StrValTest' +echo strval(new StrValTest); +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> &reftitle.seealso; <para>

« previous php.doc.cvs (#2205) next »