added missing example.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@233069 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
TAKAGI Masahiro 2007-04-01 09:38:00 +00:00
parent 82865dc185
commit 10e7495708

View file

@ -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>