CVS update: phpdoc/functions

From: Date: Tue, 15 Jun 1999 20:59:47 +0000
Subject: CVS update: phpdoc/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-6998@lists.php.net to get a copy of this message
Date: Tuesday June 15, 1999 @ 16:59 Author: jim Update of /repository/phpdoc/functions In directory php:/tmp/cvs-serv22334/functions Modified Files: cpdf.sgml datetime.sgml dl.sgml filesystem.sgml hw.sgml pcre.sgml pdf.sgml pgsql.sgml Log Message: sync with the php3/doc stuff. grr. Index: phpdoc/functions/cpdf.sgml diff -u phpdoc/functions/cpdf.sgml:1.1.1.1 phpdoc/functions/cpdf.sgml:1.2 --- phpdoc/functions/cpdf.sgml:1.1.1.1 Sun Jun 6 14:51:02 1999 +++ phpdoc/functions/cpdf.sgml Tue Jun 15 16:59:47 1999 @@ -6,26 +6,42 @@ <partintro> <simpara> - CLibPDF allows to create pdf documents with PHP. It is available + ClibPDF allows to create pdf documents with PHP. It is available at <ulink url="http://www.fastio.com">FastIO</ulink> but is not free - software. Its functionality and API is similar to Thomas Merz pdflib + software. You should definitely read the licence before you start + playing with ClibPDF. If you cannot fullfil the licence agreement + consider using pdflib by Thomas Merz, which is also very powerful. + ClibPDF functionality and API is similar to Thomas Merz pdflib but ClibPDF is according to FastIO faster and creates smaller documents. - This documentation should be read with the CLibPDF manual in reach since - it explains much of the library in more detail. + This may have changed with the new version 2.0 of pdflib. + A simple benchmark (the pdfclock.c example from pdflib 2.0 turned + into a php script) actually + show no difference in speed at all. The file size is also similar + if compression is turned off. - Many functions in CLibPDF and the php3 module as well as in pdflib + <simpara> + This documentation should be read with the ClibPDF manual in reach since + it explains much of the library in much more detail. + + <simpara> + Many functions in ClibPDF and the php3 module as well as in pdflib have the same name. - All functions exept for cpdf_open() take as a first parameter the + All functions except for cpdf_open() take as a first parameter the handle for the document on which the function is to be performed. - Currently this handle is not used internally since CLibPDF does not + Currently this handle is not used internally since ClibPDF does not support the creation of several pdf documents at the same time and - distinguishing them by a document handle. - According to the author of CLibPDF this will change in one of the - next releases. + distinguishing them by a document handle. Actually, you should not + even try it, the results are unpredictable. + According to the author of ClibPDF this will change in one of the + next releases (current version when this was written is 1.10). + If you need this functionality use the pdflib module. <simpara> - One big advantage of CLibPDF over pdflib is the possibility to create + One big advantage of ClibPDF over pdflib is the possibility to create the pdf document completely in memory without using temporary files. + It also provides the possibility to pass coordinates in a predefined + unit lenght. This is a handy feature but can be simulated with + <function>pdf_translate</function>. <simpara> Most of the functions are fairly easy to use. The most difficult part @@ -54,6 +70,103 @@ </programlisting> <para> </example> + The pdflib distribution contains a more complex example which + creates a serious of pages with an analog clock. This example + converted into php using pdflib 2.0 looks as the following (you + can see the same example in the documentation for the pdf module): + <example> + <title>pdfclock example from pdflib 2.0 distribution</title> + <programlisting> +&lt;?php +$radius = 200; +$margin = 20; +$pagecount = 40; + +$pdf = cpdf_open(0); +cpdf_set_creator($pdf, "pdf_clock.php3"); +cpdf_set_title($pdf, "Analog Clock"); + +while($pagecount-- > 0) { + cpdf_page_init($pdf, $pagecount+1, 0, 2 * ($radius + $margin), 2 * ($radius + $margin), 1.0); + + cpdf_set_page_animation($pdf, 4, 0.5, 0, 0, 0); /* wipe */ + + cpdf_translate($pdf, $radius + $margin, $radius + $margin); + cpdf_save($pdf); + cpdf_setrgbcolor($pdf, 0.0, 0.0, 1.0); + + /* minute strokes */ + cpdf_setlinewidth($pdf, 2.0); + for ($alpha = 0; $alpha < 360; $alpha += 6) + { + cpdf_rotate($pdf, 6.0); + cpdf_moveto($pdf, $radius, 0.0); + cpdf_lineto($pdf, $radius-$margin/3, 0.0); + cpdf_stroke($pdf); + } + + cpdf_restore($pdf); + cpdf_save($pdf); + + /* 5 minute strokes */ + cpdf_setlinewidth($pdf, 3.0); + for ($alpha = 0; $alpha < 360; $alpha += 30) + { + cpdf_rotate($pdf, 30.0); + cpdf_moveto($pdf, $radius, 0.0); + cpdf_lineto($pdf, $radius-$margin, 0.0); + cpdf_stroke($pdf); + } + + $ltime = getdate(); + + /* draw hour hand */ + cpdf_save($pdf); + cpdf_rotate($pdf, -(($ltime['minutes']/60.0) + $ltime['hours'] - 3.0) * 30.0); + cpdf_moveto($pdf, -$radius/10, -$radius/20); + cpdf_lineto($pdf, $radius/2, 0.0); + cpdf_lineto($pdf, -$radius/10, $radius/20); + cpdf_closepath($pdf); + cpdf_fill($pdf); + cpdf_restore($pdf); + + /* draw minute hand */ + cpdf_save($pdf); + cpdf_rotate($pdf, -(($ltime['seconds']/60.0) + $ltime['minutes'] - 15.0) * 6.0); + cpdf_moveto($pdf, -$radius/10, -$radius/20); + cpdf_lineto($pdf, $radius * 0.8, 0.0); + cpdf_lineto($pdf, -$radius/10, $radius/20); + cpdf_closepath($pdf); + cpdf_fill($pdf); + cpdf_restore($pdf); + + /* draw second hand */ + cpdf_setrgbcolor($pdf, 1.0, 0.0, 0.0); + cpdf_setlinewidth($pdf, 2); + cpdf_save($pdf); + cpdf_rotate($pdf, -(($ltime['seconds'] - 15.0) * 6.0)); + cpdf_moveto($pdf, -$radius/5, 0.0); + cpdf_lineto($pdf, $radius, 0.0); + cpdf_stroke($pdf); + cpdf_restore($pdf); + + /* draw little circle at center */ + cpdf_circle($pdf, 0, 0, $radius/30); + cpdf_fill($pdf); + + cpdf_restore($pdf); + + cpdf_finalize_page($pdf, $pagecount+1); +} + +cpdf_finalize($pdf); +Header("Content-type: application/pdf"); +cpdf_output_buffer($pdf); +cpdf_close($pdf); +?> + </programlisting> + <para> + </example> </partintro> <refentry id="function.cpdf-set-creator"> @@ -173,9 +286,9 @@ The return value will be needed in futher versons as the first parameter in all other functions writing to the pdf document. </simpara><simpara> - The CLibPDF library takes the filename "-" as a synonym for stdout. + The ClibPDF library takes the filename "-" as a synonym for stdout. If PHP is compiled as an apache module this will not work because the - way CLibPDF outputs to stdout does not work with apache. + way ClibPDF outputs to stdout does not work with apache. </simpara></note> <para> Index: phpdoc/functions/datetime.sgml diff -u phpdoc/functions/datetime.sgml:1.2 phpdoc/functions/datetime.sgml:1.3 --- phpdoc/functions/datetime.sgml:1.2 Mon Jun 7 20:20:56 1999 +++ phpdoc/functions/datetime.sgml Tue Jun 15 16:59:47 1999 @@ -68,6 +68,7 @@ <listitem><simpara>i - minutes; i.e. "00" to "59"</simpara></listitem> <listitem><simpara>j - day of the month without leading zeros; i.e. "1" to "31"</simpara></listitem> <listitem><simpara>l (lowercase 'L') - day of the week, textual, long; i.e. "Friday"</simpara></listitem> + <listitem><simpara>L - boolean for whether it is a leap year; i.e. "0" or "1"</simpara></listitem> <listitem><simpara>m - month; i.e. "01" to "12"</simpara></listitem> <listitem><simpara>n - month without leading zeros; i.e. "1" to "12"</simpara></listitem> <listitem><simpara>M - month, textual, 3 letters; i.e. "Jan"</simpara></listitem> @@ -79,8 +80,10 @@ <listitem><simpara>Y - year, 4 digits; i.e. "1999"</simpara></listitem> <listitem><simpara>y - year, 2 digits; i.e. "99"</simpara></listitem> <listitem><simpara>z - day of the year; i.e. "0" to "365"</simpara></listitem> + <listitem><simpara>Z - timezone offset in seconds (i.e. "-43200" to "43200")</simpara></listitem> </itemizedlist> Unrecognized characters in the format string will be printed as-is. + The "Z" format will always return "0" when using <function>gmdate()</function>. <example> <title><function>date</function> example</title> Index: phpdoc/functions/dl.sgml diff -u phpdoc/functions/dl.sgml:1.1.1.1 phpdoc/functions/dl.sgml:1.2 --- phpdoc/functions/dl.sgml:1.1.1.1 Sun Jun 6 14:50:42 1999 +++ phpdoc/functions/dl.sgml Tue Jun 15 16:59:47 1999 @@ -1,4 +1,4 @@ -<!-- $Id: dl.sgml,v 1.1.1.1 1999/06/06 18:50:42 sas Exp $ --> +<!-- $Id: dl.sgml,v 1.2 1999/06/15 20:59:47 jim Exp $ --> <reference id="ref.dl"> <title>Dynamic Loading Functions</title> Index: phpdoc/functions/filesystem.sgml diff -u phpdoc/functions/filesystem.sgml:1.1.1.1 phpdoc/functions/filesystem.sgml:1.2 --- phpdoc/functions/filesystem.sgml:1.1.1.1 Sun Jun 6 14:50:43 1999 +++ phpdoc/functions/filesystem.sgml Tue Jun 15 16:59:47 1999 @@ -144,7 +144,8 @@ <void> </funcsynopsis> <para> - Invoking the stat() or lstat() system call on most systems is quite + Invoking the <function>stat</function> or + <function>lstat</function> system call on most systems is quite expensive. Therefore, the result of the last call to any of the status functions (listed below) is stored for use on the next such call using the same filename. If you wish to force a new @@ -375,10 +376,13 @@ <funcdef>array <function>fgetcsv</function></funcdef> <paramdef>int <parameter>fp</parameter></paramdef> <paramdef>int <parameter>length</parameter></paramdef> + <paramdef>string <parameter><optional>delimiter</optional></parameter></paramdef> </funcsynopsis> <simpara> Similar to fgets() except that fgetcsv() parses the line it reads for fields in CSV format and returns an array containing the fields read. + The field delimiter is a comma, unless you specifiy another + delimiter with the optional third parameter. <simpara> fp must be a valid file pointer to a file successfully opened by <function>fopen</function>, <function>popen</function>, or <function>fsockopen</function> @@ -396,7 +400,7 @@ <programlisting> $row=1; $fp = fopen("test.csv","r"); -while ($data = fgetcsv($fp,1000)) { +while ($data = fgetcsv($fp,1000, ",")) { $num = count($data); print "&lt;p> $num fields in line $row: &lt;br>"; $row++; @@ -529,7 +533,7 @@ <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. </refsect1> </refentry> @@ -550,7 +554,7 @@ of an error. <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. </refsect1> </refentry> @@ -571,7 +575,7 @@ an error. <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. </refsect1> </refentry> @@ -592,7 +596,7 @@ error. <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. </refsect1> </refentry> @@ -612,7 +616,7 @@ <para> Returns the inode number of the file, or false in case of an error. <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. </refsect1> </refentry> @@ -633,7 +637,7 @@ Returns the time the file was last modified, or false in case of an <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. error. </refsect1> @@ -654,7 +658,7 @@ <para> Returns the user ID of the owner of the file, or false in case of an <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. error. </refsect1> @@ -672,10 +676,11 @@ <funcdef>int <function>fileperms</function></funcdef> <paramdef>string <parameter>filename</parameter></paramdef> </funcsynopsis> -<para> Returns the permissions on the file, or false in case of an error. + <para> + Returns the permissions on the file, or false in case of an error. <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. </refsect1> </refentry> @@ -695,7 +700,7 @@ <para> Returns the size of the file, or false in case of an error. <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. </refsect1> </refentry> @@ -719,7 +724,7 @@ <para> Returns false if an error occurs. <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. </refsect1> </refentry> @@ -1120,7 +1125,7 @@ Returns true if the filename exists and is a directory. <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. <para> See also <function>is_file</function> and <function>is_link</function>. </refsect1> @@ -1141,7 +1146,7 @@ Returns true if the filename exists and is executable. <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. <para> See also <function>is_file</function> and <function>is_link</function>. </refsect1> @@ -1162,7 +1167,7 @@ Returns true if the filename exists and is a regular file. <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. <para> See also <function>is_dir</function> and <function>is_link</function>. </refsect1> @@ -1183,7 +1188,7 @@ Returns true if the filename exists and is a symbolic link. <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. <para> See also <function>is_dir</function> and <function>is_file</function>. </refsect1> @@ -1208,7 +1213,7 @@ limitations are not taken into account. <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. <para> See also <function>is_writeable</function>. </refsect1> @@ -1235,7 +1240,7 @@ limitations are not taken into account. <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. <para> See also <function>is_readable</function>. </refsect1> @@ -1538,7 +1543,7 @@ systems (i.e. Windows) return -1 <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. </refsect1> </refentry> @@ -1582,7 +1587,7 @@ systems (i.e. Windows) return -1 <para> The results of this function are cached. See - <function>clearstatecache</function> for more details. + <function>clearstatcache</function> for more details. </refsect1> </refentry> Index: phpdoc/functions/hw.sgml diff -u phpdoc/functions/hw.sgml:1.1.1.1 phpdoc/functions/hw.sgml:1.2 --- phpdoc/functions/hw.sgml:1.1.1.1 Sun Jun 6 14:50:45 1999 +++ phpdoc/functions/hw.sgml Tue Jun 15 16:59:47 1999 @@ -328,6 +328,7 @@ <paramdef>int <parameter>object_to_change</parameter></paramdef> <paramdef>array <parameter>remove</parameter></paramdef> <paramdef>array <parameter>add</parameter></paramdef> + <paramdef>int <parameter>mode</parameter></paramdef> </funcsynopsis> <para> @@ -342,6 +343,13 @@ the value of the attribute to remove is not a string or array. <para> + The last parameter determines if the modification is performed + recursively. 1 means recurive modification. If some of the objects + cannot be modified they will be skiped without notice. + <function>hw_error</function> may not indicate an error though + some of the objects could not be modified. + + <para> The keys of both arrays are the attributes name. The value of each array element can either be an array, a string or anything else. If it is an array @@ -353,10 +361,10 @@ be performed on the attribute. This is neccessary if you want to to add a completely new attribute not just a new value for an existing attribute. If the remove array contained - an empty string for that attribute, the attribute would be tried to + an empty string for that attribute, the attribute would be tried to be removed which would fail since it doesn't exist. The following addition of a new value for that attribute would also fail. Setting the value - for that attribute to e.g. 0 would not even try to remove it since + for that attribute to e.g. 0 would not even try to remove it and the addition will work. <para> @@ -378,7 +386,7 @@ array. If the attribute is the first one with that name to add, set attribute value in the remove array to an integer. <example> - <title>adding a completly new attribute</title> + <title>adding a completely new attribute</title> <programlisting role="php"> // $connect is an existing connection to the Hyperwave server // $objid is the ID of the object to modify @@ -388,10 +396,14 @@ </programlisting> </example> <para> - Note: Multilingual attributes, e.g. 'Title', can be modified in two - ways. Either by providing the attributes value in its native form - 'language':'title' or by providing an array with elements for each - language as described above. The above example would than be: + <note> + <simpara> + Multilingual attributes, e.g. 'Title', can be modified in two + ways. Either by providing the attributes value in its native + form 'language':'title' or by providing an array with elements + for each language as described above. The above example would + than be: + </note> <example> <title>modifying Title attribute</title> <programlisting role="php"> @@ -400,7 +412,7 @@ $hw_modifyobject($connect, $objid, $remarr, $addarr); </programlisting> </example> - or + or <example> <title>modifying Title attribute</title> <programlisting role="php"> @@ -419,16 +431,32 @@ $hw_modifyobject($connect, $objid, $remarr, $addarr); </programlisting> </example> - This will remove all attributes with the name 'Title' and adds a - new 'Title' attribute. This comes in handy if you want to remove - attributes recursively. - <para> - If you need to delete all attributes with a certain name you will have - to pass an empty string as the attribute value. - <para> - Note: Only the attributes 'Title', 'Description' and 'Keyword' will + <note><simpara> + This will remove all attributes with the name 'Title' and adds + a new 'Title' attribute. This comes in handy if you want to + remove attributes recursively. + </simpara></note> + <note> + <simpara> + If you need to delete all attributes with a certain name you + will have to pass an empty string as the attribute value. + </note> + <note><simpara> + Only the attributes 'Title', 'Description' and 'Keyword' will properly handle the language prefix. If those attributes don't carry a language prefix, the prefix 'xx' will be assigned. + </simpara></note> + <note><simpara> + The 'Name' attribute is somewhat special. In some cases it cannot + be complete removed. You will get an error message 'Change of base + attribute' (not clear when this happens). Therefore you will always + have to add a new Name first and than remove the old one. + </simpara></note> + <note><simpara> + You may not suround this function by calls to + <function>hw_getandlock</function> and <function>hw_unlock</function>. + <function>hw_modifyobject</function> does this internally. + </simpara></note> <para> Returns TRUE if no error occurs otherwise FALSE. </refsect1> @@ -1600,6 +1628,25 @@ Unlocks a document, so other users regain access. <para> See also <function>hw_GetAndLock</function>. + </refsect1> + </refentry> + + <refentry id="function.hw-who"> + <refnamediv> + <refname>hw_Who</refname> + <refpurpose>List of currently logged in users</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>int <function>hw_who</function></funcdef> + <paramdef>int <parameter>connection</parameter></paramdef> + </funcsynopsis> + <para> + Returns an array of users currently logged into the Hyperwave server. + Each entry in this array is an array itself containing the elements id, + name, system, onSinceDate, onSinceTime, TotalTime and self. 'self' + is 1 if this entry belongs to the user who initianted the request. </refsect1> </refentry> Index: phpdoc/functions/pcre.sgml diff -u phpdoc/functions/pcre.sgml:1.1.1.1 phpdoc/functions/pcre.sgml:1.2 --- phpdoc/functions/pcre.sgml:1.1.1.1 Sun Jun 6 14:51:01 1999 +++ phpdoc/functions/pcre.sgml Tue Jun 15 16:59:47 1999 @@ -18,7 +18,7 @@ <para> The ending delimiter may be followed by various options that affect the matching. - See <link linkend="pattern.options">Pattern Options</link>. + See <link linkend="pcre.pattern.options">Pattern Options</link>. <para> <example> @@ -124,7 +124,7 @@ <informalexample> <programlisting> -preg_match_all("|&lt;[^>]+>(.*)&lt;/[^>]+>|U", "&lt;div align=left>a test&lt;/div>", $out, PREG_PATTERN_ORDER); +preg_match_all("|&lt;[^>]+>(.*)&lt;/[^>]+>|U", "&lt;b>example: &lt;/b>&lt;div align=left>a test&lt;/div>", $out, PREG_PATTERN_ORDER); print $out[0][0].", ".$out[0][1]."\n"; print $out[1][0].", ".$out[1][1]."\n" </programlisting> @@ -152,7 +152,7 @@ <informalexample> <programlisting> -preg_match_all("|&lt;[^>]+>(.*)&lt;/[^>]+>|U", "&lt;div align=left>a test&lt;/div>", $out, PREG_SET_ORDER); +preg_match_all("|&lt;[^>]+>(.*)&lt;/[^>]+>|U", "&lt;b>example: &lt;/b>&lt;div align=left>a test&lt;/div>", $out, PREG_SET_ORDER); print $out[0][0].", ".$out[0][1]."\n"; print $out[1][0].", ".$out[1][1]."\n" </programlisting> @@ -307,7 +307,7 @@ </refsect1> </refentry> - <refentry id="pattern.options"> + <refentry id="pcre.pattern.options"> <refnamediv> <refname>Pattern Options</refname> <refpurpose>describes possible options in regex @@ -317,7 +317,7 @@ <title>Description</title> <para> The current possible PCRE options are listed below. The names in - parentheses refer internal PCRE names for these options. + parentheses refer to internal PCRE names for these options. <para> <blockquote> @@ -453,6 +453,1093 @@ </varlistentry> </variablelist> </blockquote> + </refsect1> + </refentry> + + <refentry id="pcre.pattern.syntax"> + <refnamediv> + <refname>Pattern Syntax</refname> + <refpurpose>describes PCRE regex syntax</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <literallayout> + The PCRE library is a set of functions that implement regular + expression pattern matching using the same syntax and semantics + as Perl 5, with just a few differences (see below). The current + implementation corresponds to Perl 5.005. + </literallayout> + + <refsect1> + <title>Differences From Perl</title> + <literallayout> + The differences described here are with respect to Perl + 5.005. + + 1. By default, a whitespace character is any character that + the C library function isspace() recognizes, though it is + possible to compile PCRE with alternative character type + tables. Normally isspace() matches space, formfeed, newline, + carriage return, horizontal tab, and vertical tab. Perl 5 no + longer includes vertical tab in its set of whitespace char- + acters. The \v escape that was in the Perl documentation for + a long time was never in fact recognized. However, the char- + acter itself was treated as whitespace at least up to 5.002. + In 5.004 and 5.005 it does not match \s. + + 2. PCRE does not allow repeat quantifiers on lookahead + assertions. Perl permits them, but they do not mean what you + might think. For example, (?!a){3} does not assert that the + next three characters are not "a". It just asserts that the + next character is not "a" three times. + + 3. Capturing subpatterns that occur inside negative looka- + head assertions are counted, but their entries in the + offsets vector are never set. Perl sets its numerical vari- + ables from any such patterns that are matched before the + assertion fails to match something (thereby succeeding), but + only if the negative lookahead assertion contains just one + branch. + + 4. Though binary zero characters are supported in the sub- + ject string, they are not allowed in a pattern string + because it is passed as a normal C string, terminated by + zero. The escape sequence "\0" can be used in the pattern to + represent a binary zero. + + 5. The following Perl escape sequences are not supported: + \l, \u, \L, \U, \E, \Q. In fact these are implemented by + Perl's general string-handling and are not part of its pat- + tern matching engine. + + 6. The Perl \G assertion is not supported as it is not + relevant to single pattern matches. + + 7. Fairly obviously, PCRE does not support the (?{code}) + construction. + + 8. There are at the time of writing some oddities in Perl + 5.005_02 concerned with the settings of captured strings + when part of a pattern is repeated. For example, matching + "aba" against the pattern /^(a(b)?)+$/ sets $2 to the value + "b", but matching "aabbaa" against /^(aa(bb)?)+$/ leaves $2 + unset. However, if the pattern is changed to + /^(aa(b(b))?)+$/ then $2 (and $3) get set. + + In Perl 5.004 $2 is set in both cases, and that is also true + of PCRE. If in the future Perl changes to a consistent state + that is different, PCRE may change to follow. + + 9. Another as yet unresolved discrepancy is that in Perl + 5.005_02 the pattern /^(a)?(?(1)a|b)+$/ matches the string + "a", whereas in PCRE it does not. However, in both Perl and + PCRE /^(a)?a/ matched against "a" leaves $1 unset. + + 10. PCRE provides some extensions to the Perl regular + expression facilities: + + (a) Although lookbehind assertions must match fixed length + strings, each alternative branch of a lookbehind assertion + can match a different length of string. Perl 5.005 requires + them all to have the same length. + + (b) If PCRE_DOLLAR_ENDONLY is set and PCRE_MULTILINE is not + set, the $ meta- character matches only at the very end of + the string. + + (c) If PCRE_EXTRA is set, a backslash followed by a letter + with no special meaning is faulted. + + (d) If PCRE_UNGREEDY is set, the greediness of the repeti- + tion quantifiers is inverted, that is, by default they are + not greedy, but if followed by a question mark they are. + </literallayout> + </refsect1> + + <refsect1> + <title>Regular Expression Details</title> + <literallayout> + The syntax and semantics of the regular expressions sup- + ported by PCRE are described below. Regular expressions are + also described in the Perl documentation and in a number of + other books, some of which have copious examples. Jeffrey + Friedl's "Mastering Regular Expressions", published by + O'Reilly (ISBN 1-56592-257-3), covers them in great detail. + The description here is intended as reference documentation. + + A regular expression is a pattern that is matched against a + subject string from left to right. Most characters stand for + themselves in a pattern, and match the corresponding charac- + ters in the subject. As a trivial example, the pattern + + The quick brown fox + + matches a portion of a subject string that is identical to + itself. The power of regular expressions comes from the + ability to include alternatives and repetitions in the pat- + tern. These are encoded in the pattern by the use of <emphasis>meta</emphasis>- + <emphasis>characters</emphasis>, which do not stand for themselves but instead + are interpreted in some special way. + + There are two different sets of meta-characters: those that + are recognized anywhere in the pattern except within square + brackets, and those that are recognized in square brackets. + Outside square brackets, the meta-characters are as follows: + + \ general escape character with several uses + ^ assert start of subject (or line, in multiline + mode) + $ assert end of subject (or line, in multiline mode) + . match any character except newline (by default) + [ start character class definition + | start of alternative branch + ( start subpattern + ) end subpattern + ? extends the meaning of ( + also 0 or 1 quantifier + also quantifier minimizer + * 0 or more quantifier + + 1 or more quantifier + { start min/max quantifier + + Part of a pattern that is in square brackets is called a + "character class". In a character class the only meta- + characters are: + + \ general escape character + ^ negate the class, but only if the first character + - indicates character range + ] terminates the character class + + The following sections describe the use of each of the + meta-characters. + +BACKSLASH + The backslash character has several uses. Firstly, if it is + followed by a non-alphameric character, it takes away any + special meaning that character may have. This use of + backslash as an escape character applies both inside and + outside character classes. + + For example, if you want to match a "*" character, you write + "\*" in the pattern. This applies whether or not the follow- + ing character would otherwise be interpreted as a meta- + character, so it is always safe to precede a non-alphameric + with "\" to specify that it stands for itself. In particu- + lar, if you want to match a backslash, you write "\\". + + If a pattern is compiled with the PCRE_EXTENDED option, whi- + tespace in the pattern (other than in a character class) and + characters between a "#" outside a character class and the + next newline character are ignored. An escaping backslash + can be used to include a whitespace or "#" character as part + of the pattern. + + A second use of backslash provides a way of encoding non- + printing characters in patterns in a visible manner. There + is no restriction on the appearance of non-printing charac- + ters, apart from the binary zero that terminates a pattern, + but when a pattern is being prepared by text editing, it is + usually easier to use one of the following escape sequences + than the binary character it represents: + + \a alarm, that is, the BEL character (hex 07) + \cx "control-x", where x is any character + \e escape (hex 1B) + \f formfeed (hex 0C) + \n newline (hex 0A) + \r carriage return (hex 0D) + \t tab (hex 09) + \xhh character with hex code hh + \ddd character with octal code ddd, or backreference + + The precise effect of "\cx" is as follows: if "x" is a lower + case letter, it is converted to upper case. Then bit 6 of + the character (hex 40) is inverted. Thus "\cz" becomes hex + 1A, but "\c{" becomes hex 3B, while "\c;" becomes hex 7B. + + After "\x", up to two hexadecimal digits are read (letters + can be in upper or lower case). + + After "\0" up to two further octal digits are read. In both + cases, if there are fewer than two digits, just those that + are present are used. Thus the sequence "\0\x\07" specifies + two binary zeros followed by a BEL character. Make sure you + supply two digits after the initial zero if the character + that follows is itself an octal digit. + + The handling of a backslash followed by a digit other than 0 + is complicated. Outside a character class, PCRE reads it + and any following digits as a decimal number. If the number + is less than 10, or if there have been at least that many + previous capturing left parentheses in the expression, the + entire sequence is taken as a <emphasis>back</emphasis> <emphasis>reference</emphasis>. A description + of how this works is given later, following the discussion + of parenthesized subpatterns. + + Inside a character class, or if the decimal number is + greater than 9 and there have not been that many capturing + subpatterns, PCRE re-reads up to three octal digits follow- + ing the backslash, and generates a single byte from the + least significant 8 bits of the value. Any subsequent digits + stand for themselves. For example: + + \040 is another way of writing a space + \40 is the same, provided there are fewer than 40 + previous capturing subpatterns + \7 is always a back reference + \11 might be a back reference, or another way of + writing a tab + \011 is always a tab + \0113 is a tab followed by the character "3" + \113 is the character with octal code 113 (since there + can be no more than 99 back references) + \377 is a byte consisting entirely of 1 bits + \81 is either a back reference, or a binary zero + followed by the two characters "8" and "1" + + Note that octal values of 100 or greater must not be intro- + duced by a leading zero, because no more than three octal + digits are ever read. + + All the sequences that define a single byte value can be + used both inside and outside character classes. In addition, + inside a character class, the sequence "\b" is interpreted + as the backspace character (hex 08). Outside a character + class it has a different meaning (see below). + + The third use of backslash is for specifying generic charac- + ter types: + + \d any decimal digit + \D any character that is not a decimal digit + \s any whitespace character + \S any character that is not a whitespace character + \w any "word" character + \W any "non-word" character + + Each pair of escape sequences partitions the complete set of + characters into two disjoint sets. Any given character + matches one, and only one, of each pair. + + A "word" character is any letter or digit or the underscore + character, that is, any character which can be part of a + Perl "word". The definition of letters and digits is con- + trolled by PCRE's character tables, and may vary if locale- + specific matching is taking place (see "Locale support" + above). For example, in the "fr" (French) locale, some char- + acter codes greater than 128 are used for accented letters, + and these are matched by \w. + + These character type sequences can appear both inside and + outside character classes. They each match one character of + the appropriate type. If the current matching point is at + the end of the subject string, all of them fail, since there + is no character to match. + + The fourth use of backslash is for certain simple asser- + tions. An assertion specifies a condition that has to be met + at a particular point in a match, without consuming any + characters from the subject string. The use of subpatterns + for more complicated assertions is described below. The + backslashed assertions are + + \b word boundary + \B not a word boundary + \A start of subject (independent of multiline mode) + \Z end of subject or newline at end (independent of + multiline mode) + \z end of subject (independent of multiline mode) + + These assertions may not appear in character classes (but + note that "\b" has a different meaning, namely the backspace + character, inside a character class). + + A word boundary is a position in the subject string where + the current character and the previous character do not both + match \w or \W (i.e. one matches \w and the other matches + \W), or the start or end of the string if the first or last + character matches \w, respectively. + + The \A, \Z, and \z assertions differ from the traditional + circumflex and dollar (described below) in that they only + ever match at the very start and end of the subject string, + whatever options are set. They are not affected by the + PCRE_NOTBOL or PCRE_NOTEOL options. The difference between + \Z and \z is that \Z matches before a newline that is the + last character of the string as well as at the end of the + string, whereas \z matches only at the end. + +CIRCUMFLEX AND DOLLAR + Outside a character class, in the default matching mode, the + circumflex character is an assertion which is true only if + the current matching point is at the start of the subject + string. Inside a character class, circumflex has an entirely + different meaning (see below). + + Circumflex need not be the first character of the pattern if + a number of alternatives are involved, but it should be the + first thing in each alternative in which it appears if the + pattern is ever to match that branch. If all possible alter- + natives start with a circumflex, that is, if the pattern is + constrained to match only at the start of the subject, it is + said to be an "anchored" pattern. (There are also other con- + structs that can cause a pattern to be anchored.) + + A dollar character is an assertion which is true only if the + current matching point is at the end of the subject string, + or immediately before a newline character that is the last + character in the string (by default). Dollar need not be the + last character of the pattern if a number of alternatives + are involved, but it should be the last item in any branch + in which it appears. Dollar has no special meaning in a + character class. + + The meaning of dollar can be changed so that it matches only + at the very end of the string, by setting the + PCRE_DOLLAR_ENDONLY option at compile or matching time. This + does not affect the \Z assertion. + + The meanings of the circumflex and dollar characters are + changed if the PCRE_MULTILINE option is set. When this is + the case, they match immediately after and immediately + before an internal "\n" character, respectively, in addition + to matching at the start and end of the subject string. For + example, the pattern /^abc$/ matches the subject string + "def\nabc" in multiline mode, but not otherwise. Conse- + quently, patterns that are anchored in single line mode + because all branches start with "^" are not anchored in mul- + tiline mode. The PCRE_DOLLAR_ENDONLY option is ignored if + PCRE_MULTILINE is set. + + Note that the sequences \A, \Z, and \z can be used to match + the start and end of the subject in both modes, and if all + branches of a pattern start with \A is it always anchored, + whether PCRE_MULTILINE is set or not. + + + +FULL STOP (PERIOD, DOT) + Outside a character class, a dot in the pattern matches any + one character in the subject, including a non-printing + character, but not (by default) newline. If the PCRE_DOTALL + option is set, then dots match newlines as well. The han- + dling of dot is entirely independent of the handling of cir- + cumflex and dollar, the only relationship being that they + both involve newline characters. Dot has no special meaning + in a character class. + + + +SQUARE BRACKETS + An opening square bracket introduces a character class, ter- + minated by a closing square bracket. A closing square + bracket on its own is not special. If a closing square + bracket is required as a member of the class, it should be + the first data character in the class (after an initial cir- + cumflex, if present) or escaped with a backslash. + + A character class matches a single character in the subject; + the character must be in the set of characters defined by + the class, unless the first character in the class is a cir- + cumflex, in which case the subject character must not be in + the set defined by the class. If a circumflex is actually + required as a member of the class, ensure it is not the + first character, or escape it with a backslash. + + For example, the character class [aeiou] matches any lower + case vowel, while [^aeiou] matches any character that is not + a lower case vowel. Note that a circumflex is just a con- + venient notation for specifying the characters which are in + the class by enumerating those that are not. It is not an + assertion: it still consumes a character from the subject + string, and fails if the current pointer is at the end of + the string. + + When caseless matching is set, any letters in a class + represent both their upper case and lower case versions, so + for example, a caseless [aeiou] matches "A" as well as "a", + and a caseless [^aeiou] does not match "A", whereas a case- + ful version would. + + The newline character is never treated in any special way in + character classes, whatever the setting of the PCRE_DOTALL + or PCRE_MULTILINE options is. A class such as [^a] will + always match a newline. + + The minus (hyphen) character can be used to specify a range + of characters in a character class. For example, [d-m] + matches any letter between d and m, inclusive. If a minus + character is required in a class, it must be escaped with a + backslash or appear in a position where it cannot be inter- + preted as indicating a range, typically as the first or last + character in the class. + It is not possible to have the literal character "]" as the + end character of a range. A pattern such as [W-]46] is + interpreted as a class of two characters ("W" and "-") fol- + lowed by a literal string "46]", so it would match "W46]" or + "-46]". However, if the "]" is escaped with a backslash it + is interpreted as the end of range, so [W-\]46] is inter- + preted as a single class containing a range followed by two + separate characters. The octal or hexadecimal representation + of "]" can also be used to end a range. + + Ranges operate in ASCII collating sequence. They can also be + used for characters specified numerically, for example + [\000-\037]. If a range that includes letters is used when + caseless matching is set, it matches the letters in either + case. For example, [W-c] is equivalent to [][\^_`wxyzabc], + matched caselessly, and if character tables for the "fr" + locale are in use, [\xc8-\xcb] matches accented E characters + in both cases. + + The character types \d, \D, \s, \S, \w, and \W may also + appear in a character class, and add the characters that + they match to the class. For example, [\dABCDEF] matches any + hexadecimal digit. A circumflex can conveniently be used + with the upper case character types to specify a more res- + tricted set of characters than the matching lower case type. + For example, the class [^\W_] matches any letter or digit, + but not underscore. + + All non-alphameric characters other than \, -, ^ (at the + start) and the terminating ] are non-special in character + classes, but it does no harm if they are escaped. + + + +VERTICAL BAR + Vertical bar characters are used to separate alternative + patterns. For example, the pattern + + gilbert|sullivan + + matches either "gilbert" or "sullivan". Any number of alter- + natives may appear, and an empty alternative is permitted + (matching the empty string). The matching process tries + each alternative in turn, from left to right, and the first + one that succeeds is used. If the alternatives are within a + subpattern (defined below), "succeeds" means matching the + rest of the main pattern as well as the alternative in the + subpattern. + + + + +INTERNAL OPTION SETTING + The settings of PCRE_CASELESS, PCRE_MULTILINE, PCRE_DOTALL, + and PCRE_EXTENDED can be changed from within the pattern by + a sequence of Perl option letters enclosed between "(?" and + ")". The option letters are + + i for PCRE_CASELESS + m for PCRE_MULTILINE + s for PCRE_DOTALL + x for PCRE_EXTENDED + + For example, (?im) sets caseless, multiline matching. It is + also possible to unset these options by preceding the letter + with a hyphen, and a combined setting and unsetting such as + (?im-sx), which sets PCRE_CASELESS and PCRE_MULTILINE while + unsetting PCRE_DOTALL and PCRE_EXTENDED, is also permitted. + If a letter appears both before and after the hyphen, the + option is unset. + + The scope of these option changes depends on where in the + pattern the setting occurs. For settings that are outside + any subpattern (defined below), the effect is the same as if + the options were set or unset at the start of matching. The + following patterns all behave in exactly the same way: + + (?i)abc + a(?i)bc + ab(?i)c + abc(?i) + + which in turn is the same as compiling the pattern abc with + PCRE_CASELESS set. In other words, such "top level" set- + tings apply to the whole pattern (unless there are other + changes inside subpatterns). If there is more than one set- + ting of the same option at top level, the rightmost setting + is used. + + If an option change occurs inside a subpattern, the effect + is different. This is a change of behaviour in Perl 5.005. + An option change inside a subpattern affects only that part + of the subpattern that follows it, so + + (a(?i)b)c + + matches abc and aBc and no other strings (assuming + PCRE_CASELESS is not used). By this means, options can be + made to have different settings in different parts of the + pattern. Any changes made in one alternative do carry on + into subsequent branches within the same subpattern. For + example, + + (a(?i)b|c) + + matches "ab", "aB", "c", and "C", even though when matching + "C" the first branch is abandoned before the option setting. + This is because the effects of option settings happen at + compile time. There would be some very weird behaviour oth- + erwise. + + The PCRE-specific options PCRE_UNGREEDY and PCRE_EXTRA can + be changed in the same way as the Perl-compatible options by + using the characters U and X respectively. The (?X) flag + setting is special in that it must always occur earlier in + the pattern than any of the additional features it turns on, + even when it is at top level. It is best put at the start. + + + +SUBPATTERNS + Subpatterns are delimited by parentheses (round brackets), + which can be nested. Marking part of a pattern as a subpat- + tern does two things: + + 1. It localizes a set of alternatives. For example, the pat- + tern + + cat(aract|erpillar|) + + matches one of the words "cat", "cataract", or "caterpil- + lar". Without the parentheses, it would match "cataract", + "erpillar" or the empty string. + + 2. It sets up the subpattern as a capturing subpattern (as + defined above). When the whole pattern matches, that por- + tion of the subject string that matched the subpattern is + passed back to the caller via the <emphasis>ovector</emphasis> argument of + <function>pcre_exec</function>. Opening parentheses are counted from left to + right (starting from 1) to obtain the numbers of the captur- + ing subpatterns. + + For example, if the string "the red king" is matched against + the pattern + + the ((red|white) (king|queen)) + + the captured substrings are "red king", "red", and "king", + and are numbered 1, 2, and 3. + + The fact that plain parentheses fulfil two functions is not + always helpful. There are often times when a grouping sub- + pattern is required without a capturing requirement. If an + opening parenthesis is followed by "?:", the subpattern does + not do any capturing, and is not counted when computing the + number of any subsequent capturing subpatterns. For example, + if the string "the white queen" is matched against the + pattern + + the ((?:red|white) (king|queen)) + + the captured substrings are "white queen" and "queen", and + are numbered 1 and 2. The maximum number of captured sub- + strings is 99, and the maximum number of all subpatterns, + both capturing and non-capturing, is 200. + + As a convenient shorthand, if any option settings are + required at the start of a non-capturing subpattern, the + option letters may appear between the "?" and the ":". Thus + the two patterns + + (?i:saturday|sunday) + (?:(?i)saturday|sunday) + + match exactly the same set of strings. Because alternative + branches are tried from left to right, and options are not + reset until the end of the subpattern is reached, an option + setting in one branch does affect subsequent branches, so + the above patterns match "SUNDAY" as well as "Saturday". + + + +REPETITION + Repetition is specified by quantifiers, which can follow any + of the following items: + + a single character, possibly escaped + the . metacharacter + a character class + a back reference (see next section) + a parenthesized subpattern (unless it is an assertion - + see below) + + The general repetition quantifier specifies a minimum and + maximum number of permitted matches, by giving the two + numbers in curly brackets (braces), separated by a comma. + The numbers must be less than 65536, and the first must be + less than or equal to the second. For example: + + z{2,4} + + matches "zz", "zzz", or "zzzz". A closing brace on its own + is not a special character. If the second number is omitted, + but the comma is present, there is no upper limit; if the + second number and the comma are both omitted, the quantifier + specifies an exact number of required matches. Thus + + [aeiou]{3,} + + matches at least 3 successive vowels, but may match many + more, while + + \d{8} + + matches exactly 8 digits. An opening curly bracket that + appears in a position where a quantifier is not allowed, or + one that does not match the syntax of a quantifier, is taken + as a literal character. For example, {,6} is not a quantif- + ier, but a literal string of four characters. + + The quantifier {0} is permitted, causing the expression to + behave as if the previous item and the quantifier were not + present. + + For convenience (and historical compatibility) the three + most common quantifiers have single-character abbreviations: + + * is equivalent to {0,} + + is equivalent to {1,} + ? is equivalent to {0,1} + + It is possible to construct infinite loops by following a + subpattern that can match no characters with a quantifier + that has no upper limit, for example: + + (a?)* + + Earlier versions of Perl and PCRE used to give an error at + compile time for such patterns. However, because there are + cases where this can be useful, such patterns are now + accepted, but if any repetition of the subpattern does in + fact match no characters, the loop is forcibly broken. + + By default, the quantifiers are "greedy", that is, they + match as much as possible (up to the maximum number of per- + mitted times), without causing the rest of the pattern to + fail. The classic example of where this gives problems is in + trying to match comments in C programs. These appear between + the sequences /* and */ and within the sequence, individual + * and / characters may appear. An attempt to match C com- + ments by applying the pattern + + /\*.*\*/ + + to the string + + /* first command */ not comment /* second comment */ + + fails, because it matches the entire string due to the + greediness of the .* item. + + However, if a quantifier is followed by a question mark, + then it ceases to be greedy, and instead matches the minimum + number of times possible, so the pattern + + /\*.*?\*/ + + does the right thing with the C comments. The meaning of the + various quantifiers is not otherwise changed, just the pre- + ferred number of matches. Do not confuse this use of ques- + tion mark with its use as a quantifier in its own right. + Because it has two uses, it can sometimes appear doubled, as + in + + \d??\d + + which matches one digit by preference, but can match two if + that is the only way the rest of the pattern matches. + + If the PCRE_UNGREEDY option is set (an option which is not + available in Perl) then the quantifiers are not greedy by + default, but individual ones can be made greedy by following + them with a question mark. In other words, it inverts the + default behaviour. + + When a parenthesized subpattern is quantified with a minimum + repeat count that is greater than 1 or with a limited max- + imum, more store is required for the compiled pattern, in + proportion to the size of the minimum or maximum. + + If a pattern starts with .* or .{0,} and the PCRE_DOTALL + option (equivalent to Perl's /s) is set, thus allowing the . + to match newlines, then the pattern is implicitly anchored, + because whatever follows will be tried against every charac- + ter position in the subject string, so there is no point in + retrying the overall match at any position after the first. + PCRE treats such a pattern as though it were preceded by \A. + In cases where it is known that the subject string contains + no newlines, it is worth setting PCRE_DOTALL when the pat- + tern begins with .* in order to obtain this optimization, or + alternatively using ^ to indicate anchoring explicitly. + + When a capturing subpattern is repeated, the value captured + is the substring that matched the final iteration. For exam- + ple, after + + (tweedle[dume]{3}\s*)+ + + has matched "tweedledum tweedledee" the value of the cap- + tured substring is "tweedledee". However, if there are + nested capturing subpatterns, the corresponding captured + values may have been set in previous iterations. For exam- + ple, after + /(a|(b))+/ + + matches "aba" the value of the second captured substring is + "b". + + + +BACK REFERENCES + Outside a character class, a backslash followed by a digit + greater than 0 (and possibly further digits) is a back + reference to a capturing subpattern earlier (i.e. to its + left) in the pattern, provided there have been that many + previous capturing left parentheses. + + However, if the decimal number following the backslash is + less than 10, it is always taken as a back reference, and + causes an error only if there are not that many capturing + left parentheses in the entire pattern. In other words, the + parentheses that are referenced need not be to the left of + the reference for numbers less than 10. See the section + entitled "Backslash" above for further details of the han- + dling of digits following a backslash. + + A back reference matches whatever actually matched the cap- + turing subpattern in the current subject string, rather than + anything matching the subpattern itself. So the pattern + + (sens|respons)e and \1ibility + + matches "sense and sensibility" and "response and responsi- + bility", but not "sense and responsibility". If caseful + matching is in force at the time of the back reference, then + the case of letters is relevant. For example, + + ((?i)rah)\s+\1 + + matches "rah rah" and "RAH RAH", but not "RAH rah", even + though the original capturing subpattern is matched case- + lessly. + + There may be more than one back reference to the same sub- + pattern. If a subpattern has not actually been used in a + particular match, then any back references to it always + fail. For example, the pattern + + (a|(bc))\2 + + always fails if it starts to match "a" rather than "bc". + Because there may be up to 99 back references, all digits + following the backslash are taken as part of a potential + back reference number. If the pattern continues with a digit + character, then some delimiter must be used to terminate the + back reference. If the PCRE_EXTENDED option is set, this can + be whitespace. Otherwise an empty comment can be used. + + A back reference that occurs inside the parentheses to which + it refers fails when the subpattern is first used, so, for + example, (a\1) never matches. However, such references can + be useful inside repeated subpatterns. For example, the pat- + tern + + (a|b\1)+ + + matches any number of "a"s and also "aba", "ababaa" etc. At + each iteration of the subpattern, the back reference matches + the character string corresponding to the previous itera- + tion. In order for this to work, the pattern must be such + that the first iteration does not need to match the back + reference. This can be done using alternation, as in the + example above, or by a quantifier with a minimum of zero. + + + +ASSERTIONS + An assertion is a test on the characters following or + preceding the current matching point that does not actually + consume any characters. The simple assertions coded as \b, + \B, \A, \Z, \z, ^ and $ are described above. More compli- + cated assertions are coded as subpatterns. There are two + kinds: those that look ahead of the current position in the + subject string, and those that look behind it. + + An assertion subpattern is matched in the normal way, except + that it does not cause the current matching position to be + changed. Lookahead assertions start with (?= for positive + assertions and (?! for negative assertions. For example, + + \w+(?=;) + + matches a word followed by a semicolon, but does not include + the semicolon in the match, and + + foo(?!bar) + + matches any occurrence of "foo" that is not followed by + "bar". Note that the apparently similar pattern + + (?!foo)bar + + does not find an occurrence of "bar" that is preceded by + something other than "foo"; it finds any occurrence of "bar" + whatsoever, because the assertion (?!foo) is always true + when the next three characters are "bar". A lookbehind + assertion is needed to achieve this effect. + Lookbehind assertions start with (?&lt;= for positive asser- + tions and (?&lt;! for negative assertions. For example, + + (?&lt;!foo)bar + + does find an occurrence of "bar" that is not preceded by + "foo". The contents of a lookbehind assertion are restricted + such that all the strings it matches must have a fixed + length. However, if there are several alternatives, they do + not all have to have the same fixed length. Thus + + (?&lt;=bullock|donkey) + + is permitted, but + + (?&lt;!dogs?|cats?) + + causes an error at compile time. Branches that match dif- + ferent length strings are permitted only at the top level of + a lookbehind assertion. This is an extension compared with + Perl 5.005, which requires all branches to match the same + length of string. An assertion such as + + (?&lt;=ab(c|de)) + + is not permitted, because its single top-level branch can + match two different lengths, but it is acceptable if rewrit- + ten to use two top-level branches: + + (?&lt;=abc|abde) + + The implementation of lookbehind assertions is, for each + alternative, to temporarily move the current position back + by the fixed width and then try to match. If there are + insufficient characters before the current position, the + match is deemed to fail. Lookbehinds in conjunction with + once-only subpatterns can be particularly useful for match- + ing at the ends of strings; an example is given at the end + of the section on once-only subpatterns. + + Several assertions (of any sort) may occur in succession. + For example, + + (?&lt;=\d{3})(?&lt;!999)foo + + matches "foo" preceded by three digits that are not "999". + Furthermore, assertions can be nested in any combination. + For example, + + (?&lt;=(?&lt;!foo)bar)baz + + matches an occurrence of "baz" that is preceded by "bar" + which in turn is not preceded by "foo". + + Assertion subpatterns are not capturing subpatterns, and may + not be repeated, because it makes no sense to assert the + same thing several times. If an assertion contains capturing + subpatterns within it, these are always counted for the pur- + poses of numbering the capturing subpatterns in the whole + pattern. Substring capturing is carried out for positive + assertions, but it does not make sense for negative asser- + tions. + + Assertions count towards the maximum of 200 parenthesized + subpatterns. + + + +ONCE-ONLY SUBPATTERNS + With both maximizing and minimizing repetition, failure of + what follows normally causes the repeated item to be re- + evaluated to see if a different number of repeats allows the + rest of the pattern to match. Sometimes it is useful to + prevent this, either to change the nature of the match, or + to cause it fail earlier than it otherwise might, when the + author of the pattern knows there is no point in carrying + on. + + Consider, for example, the pattern \d+foo when applied to + the subject line + + 123456bar + + After matching all 6 digits and then failing to match "foo", + the normal action of the matcher is to try again with only 5 + digits matching the \d+ item, and then with 4, and so on, + before ultimately failing. Once-only subpatterns provide the + means for specifying that once a portion of the pattern has + matched, it is not to be re-evaluated in this way, so the + matcher would give up immediately on failing to match "foo" + the first time. The notation is another kind of special + parenthesis, starting with (?&gt; as in this example: + + (?&gt;\d+)bar + + This kind of parenthesis "locks up" the part of the pattern + it contains once it has matched, and a failure further into + the pattern is prevented from backtracking into it. Back- + tracking past it to previous items, however, works as nor- + mal. + + An alternative description is that a subpattern of this type + matches the string of characters that an identical stan- + dalone pattern would match, if anchored at the current point + in the subject string. + + Once-only subpatterns are not capturing subpatterns. Simple + cases such as the above example can be thought of as a max- + imizing repeat that must swallow everything it can. So, + while both \d+ and \d+? are prepared to adjust the number of + digits they match in order to make the rest of the pattern + match, (?&gt;\d+) can only match an entire sequence of digits. + + This construction can of course contain arbitrarily compli- + cated subpatterns, and it can be nested. + + Once-only subpatterns can be used in conjunction with look- + behind assertions to specify efficient matching at the end + of the subject string. Consider a simple pattern such as + + abcd$ + + when applied to a long string which does not match it. + Because matching proceeds from left to right, PCRE will look + for each "a" in the subject and then see if what follows + matches the rest of the pattern. If the pattern is specified + as + + ^.*abcd$ + + then the initial .* matches the entire string at first, but + when this fails, it backtracks to match all but the last + character, then all but the last two characters, and so on. + Once again the search for "a" covers the entire string, from + right to left, so we are no better off. However, if the pat- + tern is written as + + ^(?&gt;.*)(?&lt;=abcd) + + then there can be no backtracking for the .* item; it can + match only the entire string. The subsequent lookbehind + assertion does a single test on the last four characters. If + it fails, the match fails immediately. For long strings, + this approach makes a significant difference to the process- + ing time. + + + +CONDITIONAL SUBPATTERNS + It is possible to cause the matching process to obey a sub- + pattern conditionally or to choose between two alternative + subpatterns, depending on the result of an assertion, or + whether a previous capturing subpattern matched or not. The + two possible forms of conditional subpattern are + + (?(condition)yes-pattern) + (?(condition)yes-pattern|no-pattern) + + If the condition is satisfied, the yes-pattern is used; oth- + erwise the no-pattern (if present) is used. If there are + more than two alternatives in the subpattern, a compile-time + error occurs. + + There are two kinds of condition. If the text between the + parentheses consists of a sequence of digits, then the con- + dition is satisfied if the capturing subpattern of that + number has previously matched. Consider the following pat- + tern, which contains non-significant white space to make it + more readable (assume the PCRE_EXTENDED option) and to + divide it into three parts for ease of discussion: + + ( \( )? [^()]+ (?(1) \) ) + + The first part matches an optional opening parenthesis, and + if that character is present, sets it as the first captured + substring. The second part matches one or more characters + that are not parentheses. The third part is a conditional + subpattern that tests whether the first set of parentheses + matched or not. If they did, that is, if subject started + with an opening parenthesis, the condition is true, and so + the yes-pattern is executed and a closing parenthesis is + required. Otherwise, since no-pattern is not present, the + subpattern matches nothing. In other words, this pattern + matches a sequence of non-parentheses, optionally enclosed + in parentheses. + + If the condition is not a sequence of digits, it must be an + assertion. This may be a positive or negative lookahead or + lookbehind assertion. Consider this pattern, again contain- + ing non-significant white space, and with the two alterna- + tives on the second line: + + (?(?=[^a-z]*[a-z]) + \d{2}[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) + + The condition is a positive lookahead assertion that matches + an optional sequence of non-letters followed by a letter. In + other words, it tests for the presence of at least one + letter in the subject. If a letter is found, the subject is + matched against the first alternative; otherwise it is + matched against the second. This pattern matches strings in + one of the two forms dd-aaa-dd or dd-dd-dd, where aaa are + letters and dd are digits. + + + +COMMENTS + The sequence (?# marks the start of a comment which + continues up to the next closing parenthesis. Nested + parentheses are not permitted. The characters that make up a + comment play no part in the pattern matching at all. + + If the PCRE_EXTENDED option is set, an unescaped # character + outside a character class introduces a comment that contin- + ues up to the next newline character in the pattern. + + + +PERFORMANCE + Certain items that may appear in patterns are more efficient + than others. It is more efficient to use a character class + like [aeiou] than a set of alternatives such as (a|e|i|o|u). + In general, the simplest construction that provides the + required behaviour is usually the most efficient. Jeffrey + Friedl's book contains a lot of discussion about optimizing + regular expressions for efficient performance. + + When a pattern begins with .* and the PCRE_DOTALL option is + set, the pattern is implicitly anchored by PCRE, since it + can match only at the start of a subject string. However, if + PCRE_DOTALL is not set, PCRE cannot make this optimization, + because the . metacharacter does not then match a newline, + and if the subject string contains newlines, the pattern may + match from the character immediately following one of them + instead of from the very start. For example, the pattern + + (.*) second + + matches the subject "first\nand second" (where \n stands for + a newline character) with the first captured substring being + "and". In order to do this, PCRE has to retry the match + starting after every newline in the subject. + + If you are using such a pattern with subject strings that do + not contain newlines, the best performance is obtained by + setting PCRE_DOTALL, or starting the pattern with ^.* to + indicate explicit anchoring. That saves PCRE from having to + scan along the subject looking for a newline to restart at. + </literallayout> </refsect1> </refentry> </reference> Index: phpdoc/functions/pdf.sgml diff -u phpdoc/functions/pdf.sgml:1.1.1.1 phpdoc/functions/pdf.sgml:1.2 --- phpdoc/functions/pdf.sgml:1.1.1.1 Sun Jun 6 14:50:54 1999 +++ phpdoc/functions/pdf.sgml Tue Jun 15 16:59:47 1999 @@ -20,9 +20,48 @@ identical. You should also understand some of the concepts of pdf to efficiently use this module. + <simpara> + There is another php module for pdf document creation based on + FastIO's ClibPDF. It has a slightly different API. Check the + php documentation for more info. + + <simpara> + Currently two version of pdflib are support: 0.6 and 2.0. It is + recommended to use the newer version since it fixes some problems + which required a patch for the old version. Unfortunately, the + changes of the pdflib API in 2.0 have been so severe that even + some PHP functions had to be altered. Here is a list of changes: + + <itemizedlist> + <listitem> + <simpara> + The Info structure does not exist anymore. Therefore the function + <function>pdf_get_info</function> is obsolete and the functions + <function>pdf_set_info_creator</function>, + <function>pdf_set_info_title</function>, + <function>pdf_set_info_author</function>, + <function>pdf_set_info_subject</function> and + <function>pdf_set_info_keywords</function> do not take the + info structure as the first parameter but the pdf document. This + also means that the pdf document must be open before these functions + can be called. + </simpara> + </listitem> + <listitem> + <simpara> + The way a new document is opened has changed. The function + <function>pdf_open</function> takes only one parameter which is + the file handle of a file opened with <function>fopen</function>. + </simpara> + </listitem> + </itemizedlist> + <simpara> - The pdf module introduces two new types of variables. They are called - <parameter>pdfdoc</parameter> and <parameter>pdfinfo</parameter>. + The pdf module introduces two new types of variables (if pdflib 2.0 + is used it is only one new type). They are called + <parameter>pdfdoc</parameter> and <parameter>pdfinfo</parameter> + (<parameter>pdfinfo</parameter> is not existent if use pdflib 2.0 + is used. <parameter>pdfdoc</parameter> is a pointer to a PDF document and almost all functions need it as its first parameter. <parameter>pdfinfo</parameter> contains meta data about the PDF @@ -32,16 +71,18 @@ In order to output text into a PDF document you will need to provide the afm file for each font. By default these afm files are searched for in a directory named 'fonts' relative to the directory where the - php3 script is located. + php3 script is located. (Again, this was true for pdflib 0.6, newer + versions do not not neccessarily need the afm files.) <simpara> Most of the functions are fairly easy to use. The most difficult part is probably to create a very simple pdf document at all. The following - example should help to get started. It creates the file test.pdf + example should help to get started. It uses the PHP functions for + pdflib 0.6. It creates the file test.pdf with one page. The page contains the text "Times-Roman" in an - outlined 30pt font. The text is underlined. + outlined 30pt font. The text also is underlined. <example> - <title>PDF_get_info</title> + <title>Creating a PDF document with pdflib 0.6</title> <programlisting> &lt;?php $fp = fopen("test.pdf", "w"); @@ -65,23 +106,170 @@ echo "&lt;A HREF=gettest.php3>finished&lt;/A>"; ?> </programlisting> - <para> - The php3 file gettext.php3 just outputs the pdf document. - <programlisting> + </example> + + <para> + + The php3 file gettext.php3 just outputs the pdf document. + + <informalexample> + <programlisting> +&lt;?php +$fp = fopen("test.pdf", "r"); +header("Content-type: application/pdf"); +fpassthru($fp); +fclose($fp); +?> + </programlisting> + </informalexample> + + Doing the same with pdflib 2.0 looks like the following: + + <example> + <title>Creating a PDF document with pdflib 2.0</title> + <programlisting> +&lt;?php +$fp = fopen("test.pdf", "w"); +$pdf = PDF_open($fp); +pdf_set_info_author($pdf, "Uwe Steinmann"); +PDF_set_info_title($pdf, "Test for PHP3 wrapper of PDFlib 0.6"); +PDF_set_info_author($pdf, "Name of Author"); +pdf_set_info_creator($pdf, "See Author"); +pdf_set_info_subject($pdf, "Testing"); +PDF_begin_page($pdf, 595, 842); +PDF_add_outline($pdf, "Page 1"); +pdf_set_font($pdf, "Times-Roman", 30, 4); +pdf_set_text_rendering($pdf, 1); +PDF_show_xy($pdf, "Times Roman outlined", 50, 750); +pdf_moveto($pdf, 50, 740); +pdf_lineto($pdf, 330, 740); +pdf_stroke($pdf); +PDF_end_page($pdf); +PDF_close($pdf); +echo "&lt;A HREF=gettest.php3>finished&lt;/A>"; +?> + </programlisting> + <para> + The php3 file gettext.php3 is the same as above. + </example> + + The pdflib distribution contains a more complex example which + creates a serious of pages with an analog clock. This example + converted into php using pdflib 2.0 looks as the following (you + can see the same example in the documentation for the clibpdf module): + + <example> + <title>pdfclock example from pdflib 2.0 distribution</title> + <programlisting> &lt;?php - $fp = fopen("test.pdf", "r"); - header("Content-type: application/pdf"); - fpassthru($fp); - fclose($fp); +$pdffilename = "clock.pdf"; +$radius = 200; +$margin = 20; +$pagecount = 40; + +$fp = fopen($pdffilename, "w"); +$pdf = pdf_open($fp); +pdf_set_info_creator($pdf, "pdf_clock.php3"); +pdf_set_info_author($pdf, "Uwe Steinmann"); +pdf_set_info_title($pdf, "Analog Clock"); + +while($pagecount-- > 0) { + pdf_begin_page($pdf, 2 * ($radius + $margin), 2 * ($radius + $margin)); + + pdf_set_transition($pdf, 4); /* wipe */ + pdf_set_duration($pdf, 0.5); + + pdf_translate($pdf, $radius + $margin, $radius + $margin); + pdf_save($pdf); + pdf_setrgbcolor($pdf, 0.0, 0.0, 1.0); + + /* minute strokes */ + pdf_setlinewidth($pdf, 2.0); + 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); + pdf_stroke($pdf); + } + + pdf_restore($pdf); + pdf_save($pdf); + + /* 5 minute strokes */ + pdf_setlinewidth($pdf, 3.0); + 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); + pdf_stroke($pdf); + } + + $ltime = getdate(); + + /* draw hour hand */ + pdf_save($pdf); + pdf_rotate($pdf,-(($ltime['minutes']/60.0)+$ltime['hours']-3.0)*30.0); + pdf_moveto($pdf, -$radius/10, -$radius/20); + pdf_lineto($pdf, $radius/2, 0.0); + pdf_lineto($pdf, -$radius/10, $radius/20); + pdf_closepath($pdf); + pdf_fill($pdf); + pdf_restore($pdf); + + /* draw minute hand */ + pdf_save($pdf); + pdf_rotate($pdf,-(($ltime['seconds']/60.0)+$ltime['minutes']-15.0)*6.0); + pdf_moveto($pdf, -$radius/10, -$radius/20); + pdf_lineto($pdf, $radius * 0.8, 0.0); + pdf_lineto($pdf, -$radius/10, $radius/20); + pdf_closepath($pdf); + pdf_fill($pdf); + pdf_restore($pdf); + + /* draw second hand */ + pdf_setrgbcolor($pdf, 1.0, 0.0, 0.0); + pdf_setlinewidth($pdf, 2); + pdf_save($pdf); + pdf_rotate($pdf, -(($ltime['seconds'] - 15.0) * 6.0)); + pdf_moveto($pdf, -$radius/5, 0.0); + pdf_lineto($pdf, $radius, 0.0); + pdf_stroke($pdf); + pdf_restore($pdf); + + /* draw little circle at center */ + pdf_circle($pdf, 0, 0, $radius/30); + pdf_fill($pdf); + + pdf_restore($pdf); + + pdf_end_page($pdf); +} + +$pdf = pdf_close($pdf); +fclose($fp); +echo "&lt;A HREF=gettest.php3?filename=".$pdffilename.">finished&lt;/A>"; ?> -</programlisting> - </example> - </partintro> + </programlisting> + <para> + The php3 file gettext.php3 just outputs the pdf document. + <programlisting> +&lt;?php +if($filename) + $fp = fopen($filename, "r"); +else + $fp = fopen("test.pdf", "r"); +header("Content-type: application/pdf"); +fpassthru($fp); +fclose($fp); +?> + </programlisting> + </example> + </partintro> <refentry id="function.pdf-get-info"> <refnamediv> - <refname>PDF_get_info</refname> <refpurpose>Returns a default info - structure for a pdf document</refpurpose> + <refname>PDF_get_info</refname> + <refpurpose>Returns a default info structure for a pdf document</refpurpose> </refnamediv> <refsect1> <title>Description</title> @@ -94,6 +282,10 @@ default info structure for the pdf document. It can be filled with appropriate information like the author, subject etc. + <note><simpara> + This functions is not available if pdflib 2.0 support is activated. + </simpara></note> + <para> See also <function>PDF_set_info_creator</function>, <function>PDF_set_info_subject</function>. @@ -119,9 +311,16 @@ <function>PDF_open</function>. Calling it after <function>PDF_open</function> will have no effect on the document. - <note><simpara> - This function is not part of the pdf library. - </simpara></note> + <note><simpara> + This function is not part of the pdf library. + </simpara></note> + + <note><simpara> + This function takes a different first parameter if pdflib 2.0 support + is activated. The first parameter has to be the identifier of the + pdf document as returned by <function>pdf_open</function>. Consequently, + <function>pdf_open</function> has to be called before this function. + </simpara></note> <para> See also <function>PDF_get_info</function>, @@ -153,6 +352,13 @@ This function is not part of the pdf library. </simpara></note> + <note><simpara> + This function takes a different first parameter if pdflib 2.0 support + is activated. The first parameter has to be the identifier of the + pdf document as returned by <function>pdf_open</function>. Consequently, + <function>pdf_open</function> has to be called before this function. + </simpara></note> + <para> See also <function>PDF_get_info</function>, <function>PDF_set_info_xxxxx</function>. @@ -183,6 +389,13 @@ This function is not part of the pdf library. </simpara></note> + <note><simpara> + This function takes a different first parameter if pdflib 2.0 support + is activated. The first parameter has to be the identifier of the + pdf document as returned by <function>pdf_open</function>. Consequently, + <function>pdf_open</function> has to be called before this function. + </simpara></note> + <para> See also <function>PDF_get_info</function>, <function>PDF_set_info_xxxxx</function>. @@ -213,6 +426,13 @@ This function is not part of the pdf library. </simpara></note> + <note><simpara> + This function takes a different first parameter if pdflib 2.0 support + is activated. The first parameter has to be the identifier of the + pdf document as returned by <function>pdf_open</function>. Consequently, + <function>pdf_open</function> has to be called before this function. + </simpara></note> + <para> See also <function>PDF_get_info</function>, <function>PDF_set_info_xxxxx</function>. @@ -243,6 +463,13 @@ This function is not part of the pdf library. </simpara></note> + <note><simpara> + This function takes a different first parameter if pdflib 2.0 support + is activated. The first parameter has to be the identifier of the + pdf document as returned by <function>pdf_open</function>. Consequently, + <function>pdf_open</function> has to be called before this function. + </simpara></note> + <para> See also <function>PDF_get_info</function>, <function>PDF_set_info_xxxxx</function>. @@ -271,10 +498,15 @@ <function>pdf_get_info</function>. The info structure will be deleted within this function. - <note><simpara> - The return value is needed as the first parameter in all other - functions writing to the pdf document. - </simpara></note> + <note><simpara> + The return value is needed as the first parameter in all other + functions writing to the pdf document. + </simpara></note> + + <note><simpara> + This function does not require the second parameter if pdflib 2.0 support + is activated. + </simpara></note> <para> See also <function>fopen</function>, @@ -297,15 +529,21 @@ <para> The <function>PDF_close</function> function closes the pdf document. - <para>Note: Due to an unclean implementation of the pdflib 0.6 the + <note><simpara>Due to an unclean implementation of the pdflib 0.6 the internal closing of the document also closes the file. This should not be done because pdflib didn't open the file, but expects an already open file when <function>PDF_open</function> is called. Consequently it shouldn't close the file. In order to fix this - just take out line 190 of the file p_basic.c in the pdflib + just take out line 190 of the file p_basic.c in the pdflib 0.6 source distribution until the next release of pdflib will fix this. + </simpara></note> + <note><simpara> + This function works properly without any patches to pdflib if + pdflib 2.0 support is activated. + </simpara></note> + <para> See also <function>PDF_open</function>, <function>fclose</function>. @@ -426,12 +664,12 @@ font path (default is ./fonts). The last parameter <parameter>encoding</parameter> can take the following values: 0 = builtin, 1 = pdfdoc, 2 = macroman, 3 = macexpert, 4 = winansi. - You should not pass a value greater than 5, - because pdflib 0.6 does a poor error checking and dies for greater - values. + An encoding greater than 4 and less than 0 will default to winansi. - <para> - See also <function>PDF_info</function>. + <note><simpara> + This function does not need the afm files for winansi encoding if + pdflib 2.0 support is activated. + </simpara></note> </refsect1> </refentry> @@ -1434,6 +1672,58 @@ </refsect1> </refentry> + <refentry id="function.pdf-open-gif"> + <refnamediv> + <refname>PDF_open_gif</refname> + <refpurpose>Opens a GIF image</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>int <function>pdf_open_gifg</function></funcdef> + <paramdef>int <parameter>pdf document</parameter></paramdef> + <paramdef>string <parameter>file name</parameter></paramdef> + </funcsynopsis> + <para> + The <function>PDF_open_gif</function> function opens an image stored + in the file with the name <parameter>file name</parameter>. + The format of the image has to be jpeg. + <para> + See also <function>PDF_close_image</function>, + <function>PDF_open_jpeg</function>, + <function>PDF_open_memory_image</function>, + <function>PDF_execute_image</function>, + <function>PDF_place_image</function>, + <function>PDF_put_image</function>. + </refsect1> + </refentry> + + <refentry id="function.pdf-open-memory-image"> + <refnamediv> + <refname>PDF_open_memory_image</refname> + <refpurpose>Opens an image created with php3 image functions</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>int <function>pdf_open_memory_image</function></funcdef> + <paramdef>int <parameter>pdf document</parameter></paramdef> + <paramdef>string <parameter>int image</parameter></paramdef> + </funcsynopsis> + <para> + The <function>PDF_open_memory_image</function> function takes + an image created with the php3 image functions and makes it available + for the pdf document. + <para> + See also <function>PDF_close_image</function>, + <function>PDF_open_jpeg</function>, + <function>PDF_open_gif</function>, + <function>PDF_execute_image</function>, + <function>PDF_place_image</function>, + <function>PDF_put_image</function>. + </refsect1> + </refentry> + <refentry id="function.pdf-open-jpeg"> <refnamediv> <refname>PDF_open_jpeg</refname> @@ -1452,6 +1742,11 @@ The format of the image has to be jpeg. <para> See also <function>PDF_close_image</function>, + <function>PDF_open_gif</function>, + <function>PDF_open_memory_image</function>, + <function>PDF_execute_image</function>, + <function>PDF_place_image</function>, + <function>PDF_put_image</function>. </refsect1> </refentry> @@ -1472,6 +1767,8 @@ functions. <para> See also <function>PDF_open_jpeg</function>, + <function>PDF_open_gif</function>, + <function>PDF_open_memory_image</function>. </refsect1> </refentry> @@ -1495,6 +1792,8 @@ on the page at postion (<parameter>x-koor</parameter>, <parameter>x-koor</parameter>). The image can be scaled at the same time. + <para> + See also <function>PDF_put_image</function>. </refsect1> </refentry> @@ -1516,6 +1815,9 @@ displayed with the <function>PDF_execute_image</function> function. This is useful when using the same image multiple times. + <para> + See also <function>PDF_place_image</function>, + <function>PDF_execute_image</function>. </refsect1> </refentry> Index: phpdoc/functions/pgsql.sgml diff -u phpdoc/functions/pgsql.sgml:1.2 phpdoc/functions/pgsql.sgml:1.3 --- phpdoc/functions/pgsql.sgml:1.2 Mon Jun 7 10:43:43 1999 +++ phpdoc/functions/pgsql.sgml Tue Jun 15 16:59:47 1999 @@ -351,7 +351,7 @@ $row++; endwhile; ?> -&lt;PRE>&lt;? +&lt;PRE>&lt;?php $fields[] = Array ("autor", "Author"); $fields[] = Array ("jahr", " Year"); $fields[] = Array ("titel", " Title");

« previous php.dev (#6998) next »