tags in examples

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@120845 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Friedhelm Betz 2003-03-21 15:46:14 +00:00
parent 8d3b4c2a7b
commit aeed73d9cf
6 changed files with 23 additions and 7 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
<refentry id="function.gmdate">
<refnamediv>
@ -22,8 +22,10 @@
<title><function>gmdate</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
echo date ("M d Y H:i:s", mktime (0,0,0,1,1,1998));
echo gmdate ("M d Y H:i:s", mktime (0,0,0,1,1,1998));
?>
]]>
</programlisting>
</example>
@ -45,7 +47,7 @@ echo gmdate ("M d Y H:i:s", mktime (0,0,0,1,1,1998));
</para>
<para>
PHP cannot fix broken system libraries. Contact
your OS vendor for a fix to this a similar problems.
your OS vendor for a fix to this and similar problems.
</para>
</note>
<para>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
<refentry id="function.gmstrftime">
<refnamediv>
@ -25,9 +25,11 @@
<title><function>gmstrftime</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
setlocale (LC_TIME, 'en_US');
echo strftime ("%b %d %Y %H:%M:%S", mktime (20,0,0,12,31,98))."\n";
echo gmstrftime ("%b %d %Y %H:%M:%S", mktime (20,0,0,12,31,98))."\n";
?>
]]>
</programlisting>
</example>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
<refentry id="function.microtime">
<refnamediv>
@ -26,6 +26,7 @@
<title><function>microtime</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
@ -41,6 +42,7 @@ $time_end = getmicrotime();
$time = $time_end - $time_start;
echo "Did nothing in $time seconds";
?>
]]>
</programlisting>
</example>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
<refentry id="function.mktime">
<refnamediv>
@ -57,10 +57,12 @@
<title><function>mktime</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
echo date ("M-d-Y", mktime (0,0,0,12,32,1997));
echo date ("M-d-Y", mktime (0,0,0,13,1,1997));
echo date ("M-d-Y", mktime (0,0,0,1,1,1998));
echo date ("M-d-Y", mktime (0,0,0,1,1,98));
?>
]]>
</programlisting>
</example>
@ -88,11 +90,13 @@ echo date ("M-d-Y", mktime (0,0,0,1,1,98));
<title>Last day of next month</title>
<programlisting role="php">
<![CDATA[
<?php
$lastday = mktime (0,0,0,3,0,2000);
echo strftime ("Last day in Feb 2000 is: %d", $lastday);
$lastday = mktime (0,0,0,4,-31,2000);
echo strftime ("Last day in Feb 2000 is: %d", $lastday);
?>
]]>
</programlisting>
</example>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
<refentry id="function.strftime">
<refnamediv>
@ -245,6 +245,7 @@
<title><function>strftime</function> locale examples</title>
<programlisting role="php">
<![CDATA[
<?php
setlocale (LC_TIME, "C");
print (strftime ("%A in Finnish is "));
setlocale (LC_TIME, "fi_FI");
@ -253,6 +254,7 @@ setlocale (LC_TIME, "fr_FR");
print (strftime ("%A and in German "));
setlocale (LC_TIME, "de_DE");
print (strftime ("%A.\n"));
?>
]]>
</programlisting>
</example>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.8 -->
<refentry id="function.strtotime">
<refnamediv>
@ -34,6 +34,7 @@
<title><function>strtotime</function> examples</title>
<programlisting role="php">
<![CDATA[
<?php
echo strtotime ("now"), "\n";
echo strtotime ("10 September 2000"), "\n";
echo strtotime ("+1 day"), "\n";
@ -41,6 +42,7 @@ echo strtotime ("+1 week"), "\n";
echo strtotime ("+1 week 2 days 4 hours 2 seconds"), "\n";
echo strtotime ("next Thursday"), "\n";
echo strtotime ("last Monday"), "\n";
?>
]]>
</programlisting>
</example>
@ -50,12 +52,14 @@ echo strtotime ("last Monday"), "\n";
<title>Checking for failure</title>
<programlisting role="php">
<![CDATA[
<?php
$str = 'Not Good';
if (($timestamp = strtotime($str)) === -1) {
echo "The string ($str) is bogus";
} else {
echo "$str == ". date('l dS of F Y h:i:s A',$timestamp);
}
?>
]]>
</programlisting>
</example>