mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
Add procedural style to examples.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@298193 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
642cb94be6
commit
a2e4f9aee7
1 changed files with 20 additions and 5 deletions
|
@ -60,7 +60,7 @@
|
|||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>date_diff</function> example</title>
|
||||
<title>Object oriented style example of <function>DateTime::diff</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
@ -73,13 +73,28 @@ echo $interval->format('%R%d days');
|
|||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
</example>
|
||||
<example>
|
||||
<title>Procedural style example of <function>date_diff</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$first = new DateTime('2009-10-11');
|
||||
$second = new DateTime('2009-10-13');
|
||||
$interval = date_diff($first, $second);
|
||||
echo $interval->format('%R%d days');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
+2 days
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</screen>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
|
|
Loading…
Reference in a new issue