adding the PHP file and related example for the hooks chapter