takagi          Sun Apr  1 09:38:00 2007 UTC

  Modified files:              
    /phpdoc/en/reference/math/functions srand.xml 
  Log:
  added missing example.
  
  
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/math/functions/srand.xml?r1=1.11&r2=1.12&diff_format=u
Index: phpdoc/en/reference/math/functions/srand.xml
diff -u phpdoc/en/reference/math/functions/srand.xml:1.11 
phpdoc/en/reference/math/functions/srand.xml:1.12
--- phpdoc/en/reference/math/functions/srand.xml:1.11   Sat Mar 31 19:18:23 2007
+++ phpdoc/en/reference/math/functions/srand.xml        Sun Apr  1 09:38:00 2007
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.11 $ -->
+<!-- $Revision: 1.12 $ -->
 <refentry id="function.srand">
  <refnamediv>
   <refname>srand</refname>
@@ -58,6 +58,28 @@
    </informaltable>
   </para>
  </refsect1>
+ <refsect1 role="examples">
+  &reftitle.examples;
+  <para>
+   <example>
+    <title><function>srand</function> example</title>
+    <programlisting role="php">
+<![CDATA[
+<?php
+// seed with microseconds
+function make_seed()
+{
+  list($usec, $sec) = explode(' ', microtime());
+  return (float) $sec + ((float) $usec * 100000);
+}
+srand(make_seed());
+$randval = rand();
+?>
+]]>
+    </programlisting>
+   </example>
+  </para>
+ </refsect1>
  <refsect1 role="seealso">
   &reftitle.seealso;
   <para>

Reply via email to