Errata

Programming PHP

Errata for Programming PHP

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
PDF
Page 141
Example 5-2. Searching an array

The line "$array =" should not be there.





function hasRequired($array, $requiredFields) {
$array =
$keys = array_keys ( $array );
foreach ( $requiredFields as $fieldName ) {
if (! in_array ( $fieldName, $keys )) {
return false;
}
}
return true;
}

Note from the Author or Editor:
Confirmed, that line of code should not be there!

anchan42  Dec 19, 2022 
PDF
Page 461
parse_ini_string()

"If process_sections is set and is true, a multidimensional array with values for the sections in the file is returned."

this function is not for a file.

Note from the Author or Editor:
The above text should be changed to read:

If process_sections is set and is true, a multidimensional array with values for the sections in the string is returned.

RBK  Sep 06, 2020