cvs: phpdoc /en/reference/strings/functions strtr.xml wordwrap.xml
| From: | Damien Seguy | Date: | Fri, 23 May 2003 01:05:32 +0000 |
| Subject: | cvs: phpdoc /en/reference/strings/functions strtr.xml wordwrap.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969353776@lists.php.net to get a copy of this message | ||
dams Thu May 22 21:05:32 2003 EDT
Modified files:
/phpdoc/en/reference/strings/functions strtr.xml wordwrap.xml
Log:
upgrading examples
Index: phpdoc/en/reference/strings/functions/strtr.xml
diff -u phpdoc/en/reference/strings/functions/strtr.xml:1.2
phpdoc/en/reference/strings/functions/strtr.xml:1.3
--- phpdoc/en/reference/strings/functions/strtr.xml:1.2 Wed Apr 17 02:44:24 2002
+++ phpdoc/en/reference/strings/functions/strtr.xml Thu May 22 21:05:32 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
<refentry id="function.strtr">
<refnamediv>
@@ -39,7 +39,7 @@
</example>
</para>
<para>
- <function>strtr</function> can be called with only two
+ <function>strtr</function> may be called with only two
arguments. If called with two arguments it behaves in a new way:
<parameter>from</parameter> then has to be an array that contains
string -> string pairs that will be replaced in the source
@@ -47,18 +47,25 @@
longest possible match first and will *NOT* try to replace stuff
that it has already worked on.
</para>
- <para>
- Examples:
- <informalexample>
+ <example>
+ <title><function>strtr</function> example with two arguments</title>
<programlisting role="php">
<![CDATA[
-$trans = array("hello" => "hi", "hi" => "hello");
-echo strtr("hi all, I said hello", $trans) . "\n";
+<?php
+ $trans = array("hello" => "hi", "hi" => "hello");
+ echo strtr("hi all, I said hello", $trans);
+?>
]]>
</programlisting>
- </informalexample>
- This will show: "hello all, I said hi",
+ <para>
+ This will show:
</para>
+ <screen>
+<![CDATA[
+hello all, I said hi
+]]>
+ </screen>
+ </example>
<note>
<simpara>
This optional <parameter>to</parameter> and
Index: phpdoc/en/reference/strings/functions/wordwrap.xml
diff -u phpdoc/en/reference/strings/functions/wordwrap.xml:1.4
phpdoc/en/reference/strings/functions/wordwrap.xml:1.5
--- phpdoc/en/reference/strings/functions/wordwrap.xml:1.4 Sat Mar 8 19:06:57 2003
+++ phpdoc/en/reference/strings/functions/wordwrap.xml Thu May 22 21:05:32 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.142 -->
<refentry id="function.wordwrap">
<refnamediv>
@@ -20,14 +20,15 @@
</methodsynopsis>
<para>
Returns a string with <parameter>str</parameter> wrapped
- at the column number specified by the (optional)
+ at the column number specified by the optional
<parameter>width</parameter> parameter. The line is broken
using the (optional) <parameter>break</parameter> parameter.
</para>
<para>
<function>wordwrap</function> will automatically wrap at column
- 75 and break using '\n' (newline) if <parameter>width</parameter>
- or <parameter>break</parameter> are not given.
+ 75 and break using '<literal>\n</literal>' (newline) if
+ <parameter>width</parameter> or <parameter>break</parameter>
+ are not given.
</para>
<para>
If the <parameter>cut</parameter> is set to 1, the string is
@@ -51,23 +52,20 @@
echo "$newtext\n";
]]>
- </programlisting>
- </example>
- </para>
+ </programlisting>
<para>
This example would display:
</para>
- <para>
- <informalexample>
- <screen>
+ <screen>
<![CDATA[
-The quick brown fox
-jumped over the
+The quick brown fox
+
+jumped over the
+
lazy dog.
]]>
- </screen>
- </informalexample>
- </para>
+ </screen>
+ </example>
<para>
<example>
<title><function>wordwrap</function> example</title>
@@ -78,23 +76,23 @@
echo "$newtext\n";
]]>
- </programlisting>
- </example>
+ </programlisting>
</para>
<para>
This example would display:
</para>
- <para>
- <informalexample>
- <screen>
+ <screen>
<![CDATA[
-A very
-long
-wooooooo
+A very
+
+long
+
+wooooooo
+
ooooord.
]]>
</screen>
- </informalexample>
+ </example>
</para>
<para>
See also <function>nl2br</function>.