CVS update: php3/doc/functions

From: Date: Sun, 16 May 1999 18:55:07 +0000
Subject: CVS update: php3/doc/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-5717@lists.php.net to get a copy of this message
Date: Sunday May 16, 1999 @ 14:55 Author: jim Update of /repository/php3/doc/functions In directory php:/tmp/cvs-serv30713/doc/functions Modified Files: array.sgml Log Message: Add range() and shuffle() functions (with documentation!). (Yes, shuffle() can be done using usort(). I've got a hankering for speed.) Index: php3/doc/functions/array.sgml diff -u php3/doc/functions/array.sgml:1.34 php3/doc/functions/array.sgml:1.35 --- php3/doc/functions/array.sgml:1.34 Sat May 15 04:34:39 1999 +++ php3/doc/functions/array.sgml Sun May 16 14:55:07 1999 @@ -558,6 +558,27 @@ </refsect1> </refentry> + <refentry id="function.range"> + <refnamediv> + <refname>range</refname> + <refpurpose>Create an array containing a range of integers</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>array <function>range</function></funcdef> + <paramdef>int <parameter>low</parameter></paramdef> + <paramdef>int <parameter>high</parameter></paramdef> + </funcsynopsis> + <para> + <function>range</function> returns an array of integers from + <parameter>low</parameter> to <parameter>high</parameter>, + inclusive. + <para> + See <function>shuffle</function> for an example of its use. + </refsect1> + </refentry> + <refentry id="function.reset"> <refnamediv> <refname>reset</refname> @@ -615,6 +636,37 @@ <para> See also <function>arsort</function>, <function>asort</function>, <function>ksort</function>, <function>sort</function> and <function>usort</function>. + </refsect1> + </refentry> + + <refentry id="function.shuffle"> + <refnamediv> + <refname>shuffle</refname> + <refpurpose>Shuffle an array</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>void <function>shuffle</function></funcdef> + <paramdef>array <parameter>array</parameter></paramdef> + </funcsynopsis> + <para> + This function shuffles (randomizes the order of the elements in) + an array. + <example> + <title><function>shuffle</function> example</title> + <programlisting> +$numbers = range(1,20); +srand(time()); +shuffle($numbers); +while (list(,$number) = each($numbers)) { + echo "$number "; +} +</programlisting></example> + <para> + See also <function>arsort</function>, <function>asort</function>, + <function>ksort</function>, <function>rsort</function>, + <function>sort</sort> and <function>usort</function>. </refsect1> </refentry> -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#5717) next »