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:
Daniel Convissor 2010-04-20 00:18:36 +00:00
parent 642cb94be6
commit a2e4f9aee7

View file

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