Some PHP interpreters may not be configured to execute PHP code that starts with <?. It can also cause problems with XML parsing.
Solution to Question 17-2
The // comment style comments out the current line only, while /* comments out lines until a matching /* comment is encountered.
Solution to Question 17-3
If you are using include_once() and an include file is accidentally included more than once, a function redefinition error will not occur. This can easily happen when included files contain their own include lines.
Solution to Question 17-4
The code should follow the coding conventions to make it easy to read and portable:
<?php /* * this file welcomes the user. * this file welcomes the user and uses proper code styles. * * Copyright 2006 (c) O'Reilly & Associates * * @version $Id: coding_standards_example.html,v 1.2 2006/1/19 24:49:50 * */ //verify the user if ($_GET[user_id] == 'Admin') { //Welcome the admin user to the control panel. echo ('Welcome to the control panel.'); } else { //Welcome other user. echo ('Welcome.'); } ?>