cvs: phpdoc-hu /reference/array/functions array-rand.xml

From: Date: Thu, 05 Aug 2004 21:26:35 +0000
Subject: cvs: phpdoc-hu /reference/array/functions array-rand.xml
Groups: php.doc.hu 
Request: Send a blank email to doc-hu+get-887@lists.php.net to get a copy of this message
cece Thu Aug 5 17:26:35 2004 EDT Modified files: /phpdoc-hu/reference/array/functions array-rand.xml Log: sync http://cvs.php.net/diff.php/phpdoc-hu/reference/array/functions/array-rand.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc-hu/reference/array/functions/array-rand.xml diff -u phpdoc-hu/reference/array/functions/array-rand.xml:1.3 phpdoc-hu/reference/array/functions/array-rand.xml:1.4 --- phpdoc-hu/reference/array/functions/array-rand.xml:1.3 Wed Aug 14 12:56:19 2002 +++ phpdoc-hu/reference/array/functions/array-rand.xml Thu Aug 5 17:26:34 2004 @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="iso-8859-2"?> <!-- splitted from ./hu/functions/array.xml, last change in rev 1.3 --> <!-- last change to 'array-rand' in en/ tree in rev 1.13 --> -<!-- EN-Revision: 1.4 Maintainer: gerzson Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: cece Status: ready --> +<!-- CREDITS: gerzson --> <!-- OLD-Revision: 1.173/EN.1.13 --> <refentry id="function.array-rand"> <refnamediv> @@ -31,23 +32,28 @@ indexeibõl alkotott tömbbel. Ezzel a megoldással kulcsokat és elemértékeket is véletlenszerûen ki lehet választani egy tömbbõl. </para> - <para> - Az <function>srand</function> függvényt meg kell hívni, hogy - inicializálja a véletlenszám-generátort. - </para> + + &note.randomseed; + <para> <example> <title><function>array_rand</function> példa</title> <programlisting role="php"> <![CDATA[ -srand ((float) microtime() * 10000000); -$input = array ("Neo", "Morpheus", "Trinity", "Cypher", "Tank"); -$rand_keys = array_rand ($input, 2); -print $input[$rand_keys[0]]."\n"; -print $input[$rand_keys[1]]."\n"; +<?php +srand((float) microtime() * 10000000); +$input = array("Neo", "Morpheus", "Trinity", "Cypher", "Tank"); +$rand_keys = array_rand($input, 2); +print $input[$rand_keys[0]] . "\n"; +print $input[$rand_keys[1]] . "\n"; +?> ]]> </programlisting> </example> + </para> + <para> + Lásd még: + <function>shuffle</function>. </para> </refsect1> </refentry>

« previous php.doc.hu (#887) next »