PHP 5 for Dummies
Error Corrections
| Location | In Book | Correction |
|
|
||
| Pg 43 | echo _<p>Hello
World!</p>_ Underscores should be quotes. |
echo " <p>Hello World!</p>" |
|
|
||
| Pg 45 | echo _<p>Hello
World!</p>_ Underscores should be quotes. |
echo " <p>Hello World!</p>" |
|
|
||
| Pg 46 | echo _<p>Hello\n
World!</p>_ Underscores should be quotes. |
echo " <p>Hello\n World!</p>" |
|
|
||
| Pg 46 | echo _<p>Hello<br>
World!</p>_ Underscores should be quotes. |
echo " <p>Hello<br> World!</p>" |
|
|
||
| Pg 61 | $age = __; Underscores should be quotes. |
$age = ""; |
|
|
||
| Pg 81 | $string = _Hello World!_; $string = _Hello World!_; Underscores should be quotes. |
$string = "Hello
World!"; $string = "Hello World!"; |
|
|
||
| Pg 83 | $name = "Sam"; $output1 = _$name_; $output2 = _$name_; echo $output1; echo $output2; Underscores should be quotes. |
$name = "Sam"; $output1 = "$name"; $output2 = '$name'; echo $output1; echo $output2; |
|
|
||
| Pg 84 | $string = _Where is
Sally_s house_; echo $string; Underscores should be quotes. |
$string = 'Where is Sally\'s house'; |
|
|
||
| Pg 85 | $string1 = _Hello_; $string2 = _World!_; $stringall = $string1.$string2; echo $stringall; Underscores should be quotes. |
$string1 = "Hello"; $string2 = 'World!'; $stringall = $string1.$string2; echo $stringall; |
|
|
||
| Pg 85 | $stringall = $string1._
_.$string2; Underscores should be quotes. |
$stringall = $string1." ".$string2; |
|
|
||
| 143 | if (!egreg("^S[a-z]*",$string) egreg is a typo. The first g is an extra letter. |
if (!ereg("^S[a-z]*",$string) |
|
|
||
| Cheat sheet, first row | $colors[1]=red $colors[2]=blue Keys are the wrong numbers. |
$colors[0]=red $colors[1]=blue |
|
|
||
| Cheat sheet, third row | $colors[1]
= blue
$colors[2] = red Keys are the wrong numbers. |
$colors[0]
= blue $colors[1] = red |