PHP Reference Book Blog

PHP Reference: Beginner to Intermediate PHP5

Archive for the ‘Corrections’ Category

May-30-08

RegEx PERL Compatible Character Class \w

posted by Mario Lurig

(pg. 150)

Book version:

\w – Letter (a-z, A-Z)

Correct version:

\w – Letter, Digit, Underscore [a-zA-Z0-9_]

This is similar to the syntax for alphanumeric: [:alnum:]

Apr-29-08

$_SERVER['QUERY_STRING'] in Global Variables

posted by Mario Lurig

(pg. 33)

The description in the book reads:

$_SERVER['QUERY_STRING'] – The current scripts path

This description is the same as the entry above, because I made a bad edit (copy/paste for formatting). The correct description would be as follows:

$_SERVER['QUERY_STRING'] – The current query string (without the question mark)

The example is correct and accurate, and luckily this is painfully obvious thanks to the name of the key QUERY_STRING in the $_SERVER array.