- Add example to setlocale, fix examples using setlocale

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@67810 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Derick Rethans 2002-01-15 10:38:35 +00:00
parent 803d147cb0
commit 85c4cacbb6
2 changed files with 22 additions and 6 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.64 $ -->
<!-- $Revision: 1.65 $ -->
<reference id="ref.datetime">
<title>Date and Time functions</title>
<titleabbrev>Date/time</titleabbrev>
@ -1074,13 +1074,13 @@ echo strftime ("Last day in Feb 2000 is: %d", $lastday);
<title><function>strftime</function> example</title>
<programlisting role="php">
<![CDATA[
setlocale ("LC_TIME", "C");
setlocale (LC_TIME, "C");
print (strftime ("%A in Finnish is "));
setlocale ("LC_TIME", "fi_FI");
setlocale (LC_TIME, "fi_FI");
print (strftime ("%A, in French "));
setlocale ("LC_TIME", "fr_FR");
setlocale (LC_TIME, "fr_FR");
print (strftime ("%A and in German "));
setlocale ("LC_TIME", "de_DE");
setlocale (LC_TIME, "de_DE");
print (strftime ("%A.\n"));
]]>
</programlisting>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.154 $ -->
<!-- $Revision: 1.155 $ -->
<reference id="ref.strings">
<title>String functions</title>
<titleabbrev>Strings</titleabbrev>
@ -2141,6 +2141,22 @@ echo "<author id='$id'>
locale does not exist or the category name is invalid.
An invalid category name also causes a warning message.
</para>
<para>
<example>
<title>setlocale Examples</title>
<programlisting role="php">
<![CDATA[
<?php
/* Set locale to Dutch */
setlocale (LC_ALL, 'nl_NL');
/* Output: vrijdag 22 december 1978 */
echo strftime ("%A %e %B %Y", mktime (0, 0, 0, 12, 22, 1978));
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>