From bdefbeb6bb7c9ca12774243da472bf560030d85b Mon Sep 17 00:00:00 2001 From: Stefan Livieratos Date: Sat, 8 Jul 2000 13:50:19 +0000 Subject: [PATCH] Small corrections git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@27867 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/pcre.xml | 8 ++++---- functions/pdf.xml | 6 +++--- functions/pgsql.xml | 20 ++++++++++---------- functions/strings.xml | 20 ++++++++++---------- functions/swf.xml | 8 ++++---- functions/url.xml | 2 +- functions/xml.xml | 2 +- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/functions/pcre.xml b/functions/pcre.xml index 1dd045c1bd..9e939aa451 100644 --- a/functions/pcre.xml +++ b/functions/pcre.xml @@ -20,7 +20,7 @@ Examples of valid patterns - /<\/\w+>/ + /<\/\w+>/ |(\d{3})-\d+|Sm /^(?i)php[34]/ @@ -156,7 +156,7 @@ print $out[1][0].", ".$out[1][1]."\n" This example will produce: -<b>example: </b>, <div align=left>this is a test</div> +<b>example: </b>, <div align=left>this is a test</div> example: , this is a test @@ -308,7 +308,7 @@ $startDate = 5/27/1999 Using /e modifier -preg_replace ("/(<\/?)(\w+)([^>]*>)/e", +preg_replace ("/(<\/?)(\w+)([^>]*>)/e", "'\\1'.strtoupper('\\2').'\\3'", $html_body); @@ -399,7 +399,7 @@ $keywords = preg_split ("/[\s,]+/", "hypertext language, programming"); The special regular expression characters are: - . \\ + * ? [ ^ ] $ ( ) { } = ! < > | : + . \\ + * ? [ ^ ] $ ( ) { } = ! < > | : diff --git a/functions/pdf.xml b/functions/pdf.xml index 3549bfbf67..07b28c0004 100644 --- a/functions/pdf.xml +++ b/functions/pdf.xml @@ -8,7 +8,7 @@ You can use the PDF functions in PHP to create PDF files if you have the PDF library by Thomas Merz (available at &url.pdf;; - you will also need the JPEG library + you will also need the JPEG library and the TIFF library to compile this. These two libs also quite often make problems when configuring php. Follow the messages of configure to fix possible @@ -232,7 +232,7 @@ while($pagecount-- > 0) { /* minute strokes */ pdf_setlinewidth($pdf, 2.0); - for ($alpha = 0; $alpha < 360; $alpha += 6) { + for ($alpha = 0; $alpha < 360; $alpha += 6) { pdf_rotate($pdf, 6.0); pdf_moveto($pdf, $radius, 0.0); pdf_lineto($pdf, $radius-$margin/3, 0.0); @@ -244,7 +244,7 @@ while($pagecount-- > 0) { /* 5 minute strokes */ pdf_setlinewidth($pdf, 3.0); - for ($alpha = 0; $alpha < 360; $alpha += 30) { + for ($alpha = 0; $alpha < 360; $alpha += 30) { pdf_rotate($pdf, 30.0); pdf_moveto($pdf, $radius, 0.0); pdf_lineto($pdf, $radius-$margin, 0.0); diff --git a/functions/pgsql.xml b/functions/pgsql.xml index 237ff50c25..29de40b1b0 100644 --- a/functions/pgsql.xml +++ b/functions/pgsql.xml @@ -34,17 +34,17 @@ - postmaster & + postmaster & pg_connect("", "", "", "", "dbname"); OK - postmaster -i & + postmaster -i & pg_connect("", "", "", "", "dbname"); OK - postmaster & + postmaster & pg_connect("localhost", "", "", "", "dbname"); Unable to connect to PostgreSQL server: connectDB() failed: @@ -54,7 +54,7 @@ - postmaster -i & + postmaster -i & pg_connect("localhost", "", "", "", "dbname"); OK @@ -138,7 +138,7 @@ <?php $result = pg_exec($conn, "INSERT INTO verlag VALUES ('Autor')"); $cmdtuples = pg_cmdtuples($result); -echo $cmdtuples . " <- cmdtuples affected."; +echo $cmdtuples . " <- cmdtuples affected."; ?> @@ -330,10 +330,10 @@ if (!$result) { } $arr = pg_fetch_array ($result, 0); -echo $arr[0] . " <- array\n"; +echo $arr[0] . " <- array\n"; $arr = pg_fetch_array ($result, 1); -echo $arr["author"] . " <- array\n"; +echo $arr["author"] . " <- array\n"; ?> @@ -483,13 +483,13 @@ if (!$result) { } $row = pg_fetch_row ($result, 0); -echo $row[0] . " <- row\n"; +echo $row[0] . " <- row\n"; $row = pg_fetch_row ($result, 1); -echo $row[0] . " <- row\n"; +echo $row[0] . " <- row\n"; $row = pg_fetch_row ($result, 2); -echo $row[1] . " <- row\n"; +echo $row[1] . " <- row\n"; ?> diff --git a/functions/strings.xml b/functions/strings.xml index d0a3a009fb..ce3955a5c3 100644 --- a/functions/strings.xml +++ b/functions/strings.xml @@ -562,14 +562,14 @@ $pieces = explode (" ", $pizza); Translation Table Example $trans = get_html_translation_table (HTML_ENTITIES); -$str = "Hallo & <Frau> & Krämer"; +$str = "Hallo & <Frau> & Krämer"; $encoded = strtr ($str, $trans); The $encoded variable will now contain: "Hallo - &amp; - &lt;Frau&gt; - &amp; Kr&auml;mer". + &amp; + &lt;Frau&gt; + &amp; Kr&auml;mer". The cool thing is using array_flip to change @@ -580,8 +580,8 @@ $trans = array_flip ($trans); $original = strtr ($str, $trans); - The content of $original would be: "Hallo & - <Frau> & Krämer". + The content of $original would be: "Hallo & + <Frau> & Krämer". This function was added in PHP 4.0. @@ -909,7 +909,7 @@ $colon_separated = implode (":", $array); Metaphone was developed by Lawrence Philips <lphilips@verity.com>. It is described in ["Practical - Algorithms for Programmers", Binstock & Rex, Addison Wesley, + Algorithms for Programmers", Binstock & Rex, Addison Wesley, 1995]. @@ -1650,7 +1650,7 @@ $formatted = sprintf ("%01.2f", $money); - Returns < 0 if str1 is less than + Returns < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal. @@ -1711,7 +1711,7 @@ if (!strcasecmp ($var1, $var2)) { - Returns < 0 if str1 is less than + Returns < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal. @@ -1946,7 +1946,7 @@ if ($pos === false) { // note: three equal signs // in versions older than 4.0b3: $pos = strpos ($mystring, "b"); -if (is_string ($pos) && !$pos) { +if (is_string ($pos) && !$pos) { // not found... } diff --git a/functions/swf.xml b/functions/swf.xml index 7f87a400e3..c800930bf0 100644 --- a/functions/swf.xml +++ b/functions/swf.xml @@ -41,7 +41,7 @@ swf_translate (-50, 80, 0); swf_placeobject (11, 60); swf_popmatrix (); -for ($i = 0; $i < 30; $i++) { +for ($i = 0; $i < 30; $i++) { $p = $i/(30-1); swf_pushmatrix (); swf_scale (1-($p*.9), 1, 1); @@ -56,7 +56,7 @@ for ($i = 0; $i < 30; $i++) { swf_showframe (); } -for ($i = 0; $i < 30; $i++) { +for ($i = 0; $i < 30; $i++) { swf_removeobject (50); if (($i%4) == 0) { swf_showframe (); @@ -72,7 +72,7 @@ swf_closefile (); It will produce the animation found at the following url. + url="&url.swf.test;">url. @@ -1115,7 +1115,7 @@ swf_closefile (); The swf_shapeLineTo draws a line to the x,y - coordinates given by the x parameter & the + coordinates given by the x parameter & the y parameter. The current position is then set to the x,y parameters. diff --git a/functions/url.xml b/functions/url.xml index 76e3b09e2b..cc4f8c973d 100644 --- a/functions/url.xml +++ b/functions/url.xml @@ -99,7 +99,7 @@ <function>Urldecode</function> example -$a = split ('&', $querystring); +$a = split ('&', $querystring); $i = 0; while ($i < count ($a)) { $b = split ('=', $a [$i]); diff --git a/functions/xml.xml b/functions/xml.xml index a355a779f4..57bf773aa2 100644 --- a/functions/xml.xml +++ b/functions/xml.xml @@ -626,7 +626,7 @@ var $parser; function xml() { $this->parser = xml_parser_create(); - xml_set_object($this->parser,&$this); + xml_set_object($this->parser,&$this); xml_set_element_handler($this->parser,"tag_open","tag_close"); xml_set_character_data_handler($this->parser,"cdata"); }