ltrim() and rtrim() function examples

The examples presented for both ltrim() and rtrim() are accurate in their results, however the stated functions used is actually trim(). Thus, here are the corrected examples:

$string = "  \n Hello World!";
echo ltrim($string);

Hello World!

echo ltrim($string, " \nA..Ha..z!");
// All capital letters between A and H, all lowercase letters, exclamation point, space, and newline



$string = "!Hello World42! \t\t";
echo rtrim($string);

!Hello World42!

echo rtrim($string, " \t!0..9");
// Range included is all numbers between 0 and 9, tab, space, and exclamation point.

!Hello World

fwrite() has a Double Tip that is Misplaced

On page 131, the fwrite() function has a TIP that reads:
To read the entire file into a string, use the function filesize().

// file.txt contains the sentence: Hello World!
$filename = 'file.txt';
$file = fopen($filename, 'r');
$string = fread( $file, filesize($filename) );
// file.txt now contains at the end: Hello World!

You’ll notice that this is the same tip as fread() and doesn’t belong. It should be considered ‘removed’.