philip Fri May 30 12:36:18 2003 EDT
Modified files:
/phpdoc/en/reference/strings/functions number-format.xml
money-format.xml strtr.xml
strtok.xml
Log:
Example WS and php tags
Index: phpdoc/en/reference/strings/functions/number-format.xml
diff -u phpdoc/en/reference/strings/functions/number-format.xml:1.2
phpdoc/en/reference/strings/functions/number-format.xml:1.3
--- phpdoc/en/reference/strings/functions/number-format.xml:1.2 Mon Nov 11 20:44:29
2002
+++ phpdoc/en/reference/strings/functions/number-format.xml Fri May 30 12:36:18
2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/math.xml, last change in rev 1.2 -->
<refentry id="function.number-format">
<refnamediv>
@@ -58,21 +58,21 @@
<![CDATA[
<?php
- $number = 1234.56;
+$number = 1234.56;
- // english notation (default)
- $english_format_number = number_format($number);
- // 1,234
+// english notation (default)
+$english_format_number = number_format($number);
+// 1,234
- // French notation
- $nombre_format_francais = number_format($number, 2, ',', ' ');
- // 1 234,56
+// French notation
+$nombre_format_francais = number_format($number, 2, ',', ' ');
+// 1 234,56
- $number = 1234.5678;
+$number = 1234.5678;
- // english notation without thousands seperator
- $english_format_number = number_format($number, 2, '.', '');
- // 1234.57
+// english notation without thousands seperator
+$english_format_number = number_format($number, 2, '.', '');
+// 1234.57
?>
]]>
Index: phpdoc/en/reference/strings/functions/money-format.xml
diff -u phpdoc/en/reference/strings/functions/money-format.xml:1.3
phpdoc/en/reference/strings/functions/money-format.xml:1.4
--- phpdoc/en/reference/strings/functions/money-format.xml:1.3 Mon Dec 30 01:51:54
2002
+++ phpdoc/en/reference/strings/functions/money-format.xml Fri May 30 12:36:18
2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<refentry id="function.money-format">
<refnamediv>
<refname>money_format</refname>
@@ -218,44 +218,44 @@
<![CDATA[
<?php
- $number = 1234.56;
+$number = 1234.56;
- // let's print the international format for the en_US locale
- setlocale(LC_MONETARY, 'en_US');
- echo money_format('%i', $number)."\n";
- // USD 1,234.56
+// let's print the international format for the en_US locale
+setlocale(LC_MONETARY, 'en_US');
+echo money_format('%i', $number)."\n";
+// USD 1,234.56
- // Italian national format with 2 decimals`
- setlocale(LC_MONETARY, 'it_IT');
- echo money_format('%.2n', $number)."\n";
- // L. 1.234,56
+// Italian national format with 2 decimals`
+setlocale(LC_MONETARY, 'it_IT');
+echo money_format('%.2n', $number)."\n";
+// L. 1.234,56
- // Using a negative number
- $number = -1234.5672;
+// Using a negative number
+$number = -1234.5672;
- // US national format, using () for negative numbers
- // and 10 digits for left precision
- setlocale(LC_MONETARY, 'en_US');
- echo money_format('%(#10n', $number)."\n";
- // ($ 1,234.57)
+// US national format, using () for negative numbers
+// and 10 digits for left precision
+setlocale(LC_MONETARY, 'en_US');
+echo money_format('%(#10n', $number)."\n";
+// ($ 1,234.57)
- // Similar format as above, adding the use of 2 digits of right
- // precision and '*' as a fill character
- echo money_format('%=*(#10.2n', $number)."\n";
- // ($********1,234.57)
+// Similar format as above, adding the use of 2 digits of right
+// precision and '*' as a fill character
+echo money_format('%=*(#10.2n', $number)."\n";
+// ($********1,234.57)
- // Let's justify to the left, with 14 positions of width, 8 digits of
- // left precision, 2 of right precision, withouth grouping character
- // and using the international format for the de_DE locale.
- setlocale(LC_MONETARY, 'de_DE');
- echo money_format('%=*^-14#8.2i', 1234.56)."\n";
- // DEM 1234,56****
+// Let's justify to the left, with 14 positions of width, 8 digits of
+// left precision, 2 of right precision, withouth grouping character
+// and using the international format for the de_DE locale.
+setlocale(LC_MONETARY, 'de_DE');
+echo money_format('%=*^-14#8.2i', 1234.56)."\n";
+// DEM 1234,56****
- // Let's add some blurb before and after the conversion specification
- setlocale(LC_MONETARY, 'en_GB');
- $fmt = 'The final value is %i (after a 10%% discount)';
- echo money_format($fmt, 1234.56)."\n";
- // The final value is GBP 1,234.56 (after a 10% discount)
+// Let's add some blurb before and after the conversion specification
+setlocale(LC_MONETARY, 'en_GB');
+$fmt = 'The final value is %i (after a 10%% discount)';
+echo money_format($fmt, 1234.56)."\n";
+// The final value is GBP 1,234.56 (after a 10% discount)
?>
]]>
Index: phpdoc/en/reference/strings/functions/strtr.xml
diff -u phpdoc/en/reference/strings/functions/strtr.xml:1.3
phpdoc/en/reference/strings/functions/strtr.xml:1.4
--- phpdoc/en/reference/strings/functions/strtr.xml:1.3 Thu May 22 21:05:32 2003
+++ phpdoc/en/reference/strings/functions/strtr.xml Fri May 30 12:36:18 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/strings.xml, last change in rev 1.2 -->
<refentry id="function.strtr">
<refnamediv>
@@ -33,7 +33,9 @@
<title><function>strtr</function> example</title>
<programlisting role="php">
<![CDATA[
+<?php
$addr = strtr($addr, "���", "aao");
+?>
]]>
</programlisting>
</example>
@@ -52,8 +54,8 @@
<programlisting role="php">
<![CDATA[
<?php
- $trans = array("hello" => "hi", "hi" => "hello");
- echo strtr("hi all, I said hello", $trans);
+$trans = array("hello" => "hi", "hi" => "hello");
+echo strtr("hi all, I said hello", $trans);
?>
]]>
</programlisting>
Index: phpdoc/en/reference/strings/functions/strtok.xml
diff -u phpdoc/en/reference/strings/functions/strtok.xml:1.2
phpdoc/en/reference/strings/functions/strtok.xml:1.3
--- phpdoc/en/reference/strings/functions/strtok.xml:1.2 Wed Apr 17 02:44:23
2002
+++ phpdoc/en/reference/strings/functions/strtok.xml Fri May 30 12:36:18 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.strtok">
<refnamediv>
@@ -24,6 +24,7 @@
<title><function>strtok</function> example</title>
<programlisting role="php">
<![CDATA[
+<?php
$string = "This is\tan example\nstring";
/* Use tab and newline as tokenizing characters as well */
$tok = strtok($string," \n\t");
@@ -31,6 +32,7 @@
echo "Word=$tok<br>";
$tok = strtok(" \n\t");
}
+?>
]]>
</programlisting>
</example>
@@ -53,14 +55,16 @@
<title>Old <function>strtok</function> behavior</title>
<programlisting role="php">
<![CDATA[
- $first_token = strtok('/something', '/');
- $second_token = strtok('/');
- var_dump ($first_token, $second_token);
+<?php
+$first_token = strtok('/something', '/');
+$second_token = strtok('/');
+var_dump ($first_token, $second_token);
/* Output:
string(0) ""
string(9) "something"
*/
+?>
]]>
</programlisting>
</example>
@@ -68,14 +72,16 @@
<title>New <function>strtok</function> behavior</title>
<programlisting role="php">
<![CDATA[
- $first_token = strtok('/something', '/');
- $second_token = strtok('/');
- var_dump ($first_token, $second_token);
+<?php
+$first_token = strtok('/something', '/');
+$second_token = strtok('/');
+var_dump ($first_token, $second_token);
/* Output:
string(9) "something"
bool(false)
*/
+?>
]]>
</programlisting>
</example>
--
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php