mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 08:28:54 +00:00
parent
625dc345db
commit
8a058e9acd
12 changed files with 26 additions and 56 deletions
|
@ -382,8 +382,7 @@ FOO;
|
|||
|
||||
preg_match_all('/(?P<name>\w+): (?P<digit>\d+)/', $str, $matches);
|
||||
|
||||
/* This also works in PHP 5.2.2 (PCRE 7.0) and later, however
|
||||
* the above form is recommended for backwards compatibility */
|
||||
/* Alternative */
|
||||
// preg_match_all('/(?<name>\w+): (?<digit>\d+)/', $str, $matches);
|
||||
|
||||
print_r($matches);
|
||||
|
|
|
@ -358,8 +358,7 @@ $str = 'foobar: 2008';
|
|||
|
||||
preg_match('/(?P<name>\w+): (?P<digit>\d+)/', $str, $matches);
|
||||
|
||||
/* This also works in PHP 5.2.2 (PCRE 7.0) and later, however
|
||||
* the above form is recommended for backwards compatibility */
|
||||
/* Alternative */
|
||||
// preg_match('/(?<name>\w+): (?<digit>\d+)/', $str, $matches);
|
||||
|
||||
print_r($matches);
|
||||
|
|
|
@ -145,8 +145,7 @@
|
|||
<refsect1 role="errors">
|
||||
&reftitle.errors;
|
||||
<para>
|
||||
As of PHP 5.5.0 <constant>E_DEPRECATED</constant> level error is emitted when
|
||||
passing in the "\e" modifier. As of PHP 7.0.0 using the "\e" modifier is an error;
|
||||
Using the "\e" modifier is an error;
|
||||
an <constant>E_WARNING</constant> is emitted in this case.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<title>Differences from POSIX regex</title>
|
||||
|
||||
<para>
|
||||
As of PHP 5.3.0, the <link linkend="book.regex">POSIX Regex</link> extension
|
||||
The <link linkend="book.regex">POSIX Regex</link> extension
|
||||
is deprecated. There are a number of differences between POSIX regex and
|
||||
PCRE regex. This page lists the most notable ones that are necessary to
|
||||
know when converting to PCRE.
|
||||
|
|
|
@ -461,11 +461,11 @@
|
|||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><emphasis>\h</emphasis></term>
|
||||
<listitem><simpara>any horizontal whitespace character (since PHP 5.2.4)</simpara></listitem>
|
||||
<listitem><simpara>any horizontal whitespace character</simpara></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><emphasis>\H</emphasis></term>
|
||||
<listitem><simpara>any character that is not a horizontal whitespace character (since PHP 5.2.4)</simpara></listitem>
|
||||
<listitem><simpara>any character that is not a horizontal whitespace character</simpara></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><emphasis>\s</emphasis></term>
|
||||
|
@ -477,11 +477,11 @@
|
|||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><emphasis>\v</emphasis></term>
|
||||
<listitem><simpara>any vertical whitespace character (since PHP 5.2.4)</simpara></listitem>
|
||||
<listitem><simpara>any vertical whitespace character</simpara></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><emphasis>\V</emphasis></term>
|
||||
<listitem><simpara>any character that is not a vertical whitespace character (since PHP 5.2.4)</simpara></listitem>
|
||||
<listitem><simpara>any character that is not a vertical whitespace character</simpara></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><emphasis>\w</emphasis></term>
|
||||
|
@ -604,8 +604,8 @@
|
|||
</para>
|
||||
|
||||
<para>
|
||||
<literal>\K</literal> can be used to reset the match start since
|
||||
PHP 5.2.4. For example, the pattern <literal>foo\Kbar</literal> matches
|
||||
<literal>\K</literal> can be used to reset the match start.
|
||||
For example, the pattern <literal>foo\Kbar</literal> matches
|
||||
"foobar", but reports that it has matched "bar". The use of
|
||||
<literal>\K</literal> does not interfere with the setting of captured
|
||||
substrings. For example, when the pattern <literal>(foo)\Kbar</literal>
|
||||
|
@ -1277,7 +1277,7 @@
|
|||
<para>
|
||||
In UTF-8 mode, characters with values greater than 128 do not match any
|
||||
of the POSIX character classes.
|
||||
As of PHP 5.3.0 and libpcre 8.10 some character classes are changed to use
|
||||
As of libpcre 8.10 some character classes are changed to use
|
||||
Unicode character properties, in which case the mentioned restriction does
|
||||
not apply. Refer to the <link xlink:href="&url.pcre.man;">PCRE(3) manual</link>
|
||||
for details.
|
||||
|
@ -1490,7 +1490,7 @@
|
|||
It is possible to name a subpattern using the syntax
|
||||
<literal>(?P<name>pattern)</literal>. This subpattern will then
|
||||
be indexed in the matches array by its normal numeric position and
|
||||
also by name. PHP 5.2.2 introduced two alternative syntaxes
|
||||
also by name. There are two alternative syntaxes
|
||||
<literal>(?<name>pattern)</literal> and <literal>(?'name'pattern)</literal>.
|
||||
</para>
|
||||
|
||||
|
@ -1782,7 +1782,7 @@
|
|||
example above, or by a quantifier with a minimum of zero.
|
||||
</para>
|
||||
<para>
|
||||
As of PHP 5.2.2, the <literal>\g</literal> escape sequence can be
|
||||
The <literal>\g</literal> escape sequence can be
|
||||
used for absolute and relative referencing of subpatterns.
|
||||
This escape sequence must be followed by an unsigned number or a negative
|
||||
number, optionally enclosed in braces. The sequences <literal>\1</literal>,
|
||||
|
@ -1803,11 +1803,10 @@
|
|||
</para>
|
||||
<para>
|
||||
Back references to the named subpatterns can be achieved by
|
||||
<literal>(?P=name)</literal> or, since PHP 5.2.2, also by
|
||||
<literal>\k<name></literal> or <literal>\k'name'</literal>.
|
||||
Additionally PHP 5.2.4 added support for <literal>\k{name}</literal>
|
||||
and <literal>\g{name}</literal>, and PHP 5.2.7 for
|
||||
<literal>\g<name></literal> and <literal>\g'name'</literal>.
|
||||
<literal>(?P=name)</literal>,
|
||||
<literal>\k<name></literal>, <literal>\k'name'</literal>,
|
||||
<literal>\k{name}</literal>, <literal>\g{name}</literal>,
|
||||
<literal>\g<name></literal> or <literal>\g'name'</literal>.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
|
|
@ -27,9 +27,7 @@
|
|||
should use a full-blown abstraction layer if you need that facility.
|
||||
</para>
|
||||
<para>
|
||||
PDO ships with PHP 5.1, and is available as a PECL extension for PHP 5.0;
|
||||
PDO requires the new OO features in the core of PHP 5, and so will not
|
||||
run with earlier versions of PHP.
|
||||
PDO ships with PHP.
|
||||
</para>
|
||||
</preface>
|
||||
<!-- }}} -->
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<step>
|
||||
<para>
|
||||
PDO and the <link linkend="ref.pdo-sqlite">PDO_SQLITE</link> driver
|
||||
is enabled by default as of PHP 5.1.0. You may need
|
||||
is enabled by default. You may need
|
||||
to enable the PDO driver for your database of choice; consult the
|
||||
documentation for
|
||||
<link linkend="pdo.drivers">database-specific PDO drivers</link>
|
||||
|
@ -42,24 +42,7 @@ extension=pdo.so
|
|||
<title>Windows users</title>
|
||||
<step>
|
||||
<para>
|
||||
PDO and all the major drivers ship with PHP as shared extensions, and
|
||||
simply need to be activated by editing the &php.ini; file:
|
||||
<screen>
|
||||
<![CDATA[
|
||||
extension=php_pdo.dll
|
||||
]]>
|
||||
</screen>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
This step is not necessary for PHP 5.3 and above, as a DLL is no longer
|
||||
required for PDO.
|
||||
</para>
|
||||
</note>
|
||||
</step>
|
||||
<step>
|
||||
<para>
|
||||
Next, choose the other database-specific DLL files and either use
|
||||
Choose the other database-specific DLL files and either use
|
||||
<function>dl</function> to load them at runtime, or enable them in
|
||||
&php.ini; below <filename>php_pdo.dll</filename>. For example:
|
||||
<screen>
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
As of PHP 5.3.0, the parser used for emulated prepared statements and for
|
||||
The parser used for emulated prepared statements and for
|
||||
rewriting named or question mark style parameters supports the non standard
|
||||
backslash escapes for single- and double quotes. That means that terminating
|
||||
quotes immediately preceeded by a backslash are not recognized as such, which
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
Microsoft SQL Server and Sybase databases through the FreeTDS library.
|
||||
</para>
|
||||
<para>
|
||||
This extension is not available anymore on Windows with PHP 5.3 or later.
|
||||
This extension is not available anymore on Windows.
|
||||
</para>
|
||||
<para>
|
||||
On Windows, you should use SqlSrv, an alternative driver for MS SQL is
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<para>
|
||||
When compiling, use <option role="configure">--with-pdo-mysql[=DIR]</option> to install
|
||||
the PDO MySQL extension, where the optional <literal>[=DIR]</literal>
|
||||
is the MySQL base library. As of PHP 5.4, <link linkend="book.mysqlnd">mysqlnd</link>
|
||||
is the MySQL base library. <link linkend="book.mysqlnd">Mysqlnd</link>
|
||||
is the default library. For details about choosing a library, see
|
||||
<link linkend="mysqlinfo.library.choosing">Choosing a MySQL library</link>.
|
||||
</para>
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<title>PDO_ODBC on UNIX systems</title>
|
||||
<step>
|
||||
<para>
|
||||
As of PHP 5.1, PDO_ODBC is included in the PHP source. You can compile the
|
||||
PDO_ODBC is included in the PHP source. You can compile the
|
||||
PDO_ODBC extension as either a static or shared module using the following
|
||||
<command>configure</command> commands.
|
||||
<variablelist>
|
||||
|
|
|
@ -5,18 +5,11 @@
|
|||
<para>
|
||||
The PDO_SQLSRV extension is enabled by adding appropriate DLL file to your PHP
|
||||
extension directory and the corresponding entry to the &php.ini; file. The
|
||||
PDO_SQLSRV download comes 8 driver files, four of which are for PDO support.
|
||||
If you are running non-thread-safe PHP (PHP 5.3), use the php_pdo_sqlsrv_53_nts.dll
|
||||
file. (You should use a non-thread-safe version if you are using IIS as your
|
||||
web server). If you are running thread-safe PHP, use the php_pdo_sqlsrv_53_ts.dll
|
||||
file. Similarly for PHP 5.4, use the php_pdo_sqlsrv_54_nts.dll or php_pdo_sqlsrv_54_ts.dll
|
||||
depending on whether your PHP installation is non-thread-safe or thread-safe.
|
||||
PDO_SQLSRV download comes with 8 driver files, four of which are for PDO support.
|
||||
</para>
|
||||
<para>
|
||||
The most recent version of the driver is available for download here:
|
||||
<link xlink:href="&url.sqlsrv;">SQLSRV download</link>. If you need support
|
||||
for PHP 5.2 and/or PHP compiled with VC6, use the 2.0 release of the driver:
|
||||
<link xlink:href="&url.sqlsrv.v2driverdownload;">SQLSRV 2.0 download</link>.
|
||||
<link xlink:href="&url.sqlsrv;">SQLSRV download</link>.
|
||||
The driver sources are hosted in a <link xlink:href="&url.sqlsrv.repo;">public repository</link>.
|
||||
</para>
|
||||
<para>
|
||||
|
|
Loading…
Reference in a new issue