mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
added example
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@146706 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
dc61753b79
commit
cee1e32056
3 changed files with 72 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/math.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.mt-rand">
|
||||
<refnamediv>
|
||||
|
@ -33,7 +33,31 @@
|
|||
between 5 and 15 (inclusive), for example, use <literal>mt_rand
|
||||
(5, 15)</literal>.
|
||||
</simpara>
|
||||
|
||||
<para>
|
||||
<example>
|
||||
<title><function>mt_rand</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
echo mt_rand() . "\n";
|
||||
echo mt_rand() . "\n";
|
||||
|
||||
echo mt_rand(5, 15);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
The above example will output something similar to:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
1604716014
|
||||
1478613278
|
||||
6
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
¬e.randomseed;
|
||||
|
||||
<note>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- splitted from ./en/functions/math.xml, last change in rev 1.2 -->
|
||||
<refentry id="function.octdec">
|
||||
<refnamediv>
|
||||
|
@ -18,6 +18,28 @@
|
|||
The largest number that can be converted is 17777777777 or 2147483647 in
|
||||
decimal.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>octdec</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
echo octdec('77') . "\n";
|
||||
echo octdec(decoct(45));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
The above example will output:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
63
|
||||
45
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also <function>decoct</function>,
|
||||
<function>bindec</function>,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<refentry id="function.mime-content-type">
|
||||
<refnamediv>
|
||||
<refname>mime_content_type</refname>
|
||||
|
@ -17,6 +17,28 @@
|
|||
Content types are returned in MIME format, like <literal>text/plain</literal>
|
||||
or <literal>application/octet-stream</literal>.
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title><function>mime_content_type</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
echo mime_content_type("php.gif") . "\n";
|
||||
echo mime_content_type("test.php");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
The above example will output:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
image/gif
|
||||
text/plain
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
|
Loading…
Reference in a new issue