cvs: phpdoc-zh /reference/math/functions rand.xml
| From: | liuming | Date: | Fri, 12 Aug 2005 03:39:00 +0000 |
| Subject: | cvs: phpdoc-zh /reference/math/functions rand.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-2199@lists.php.net to get a copy of this message | ||
lm92 Thu Aug 11 23:39:00 2005 EDT
Modified files:
/phpdoc-zh/reference/math/functions rand.xml
Log:
updated to en version
http://cvs.php.net/diff.php/phpdoc-zh/reference/math/functions/rand.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc-zh/reference/math/functions/rand.xml
diff -u phpdoc-zh/reference/math/functions/rand.xml:1.2
phpdoc-zh/reference/math/functions/rand.xml:1.3
--- phpdoc-zh/reference/math/functions/rand.xml:1.2 Mon Aug 18 21:55:08 2003
+++ phpdoc-zh/reference/math/functions/rand.xml Thu Aug 11 23:38:58 2005
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="gb2312"?>
-<!-- $Revision: 1.2 $ -->
-<!-- $Author: dallas $ -->
-<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready -->
+<!-- $Revision: 1.3 $ -->
+<!-- $Author: lm92 $ -->
+<!-- EN-Revision: 1.15 Maintainer: dallas Status: ready -->
+<!-- CREDITS: lm92 -->
<refentry id="function.rand">
<refnamediv>
<refname>rand</refname>
- <refpurpose>²úÉúÒ»¸öËæ»úÊý</refpurpose>
+ <refpurpose>²úÉúÒ»¸öËæ»úÕûÊý</refpurpose>
</refnamediv>
<refsect1>
<title>˵Ã÷</title>
@@ -18,13 +19,38 @@
Èç¹ûûÓÐÌṩ¿ÉÑ¡²ÎÊý <parameter>min</parameter> ºÍ
<parameter>max</parameter>£¬<function>rand</function>
·µ»Ø 0 µ½ <constant>RAND_MAX</constant>
- Ö®¼äµÄÎ±Ëæ»úÊý¡£ÀýÈçÏëÒª 5 µ½ 15£¨°üÀ¨ 5 ºÍ
15£©Ö®¼äµÄËæ»úÊý£¬ÓÃ
+ Ö®¼äµÄÎ±Ëæ»úÕûÊý¡£ÀýÈçÏëÒª 5 µ½ 15£¨°üÀ¨ 5 ºÍ
15£©Ö®¼äµÄËæ»úÊý£¬ÓÃ
<literal>rand(5, 15)</literal>¡£
</simpara>
+ <para>
+ <example>
+ <title><function>rand</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+echo rand() . "\n";
+echo rand() . "\n";
+
+echo rand(5, 15);
+?>
+]]>
+ </programlisting>
+ &example.outputs.similar;
+ <screen>
+<![CDATA[
+7771
+22264
+11
+]]>
+ </screen>
+ </example>
+ </para>
<note>
<simpara>
ÔÚijЩƽ̨Ï£¨ÀýÈç Windows£©<constant>RAND_MAX</constant>
- Ö»ÓÐ 32768¡£Èç¹ûÄãÐèÒªµÄ·¶Î§´óÓÚ 32768£¬¿¼ÂÇÓÃ
<function>mt_rand</function> À´Ìæ´úÖ®¡£
+ Ö»ÓÐ 32768¡£Èç¹ûÐèÒªµÄ·¶Î§´óÓÚ 32768£¬ÄÇôָ¶¨
<parameter>min</parameter>
+ ºÍ <parameter>max</parameter> ²ÎÊý¾Í¿ÉÒÔÉú³É´óÓÚ
RAND_MAXµÄÊýÁË£¬»òÕß¿¼ÂÇÓÃ
+ <function>mt_rand</function> À´Ìæ´úÖ®¡£
</simpara>
</note>
¬e.randomseed;