Question:
(a) With the help of a diagram, illustrate how Three-Tier Web application architecture operates.
(b) Explain how syntax errors occur in PHP.
(c) Exceptions are used to change the normal flow of a script if a specified error occurs.
(i) Explain what happens when an Exception is triggered?
(ii) Describe how the Try, Throw and Catch statements are used to handle an exception.
(d) Write a PHP program that allows you to:
(i) create the text file "test.txt"
(ii) insert the text: "Hello dear" into the file
(iii) append the text: "Welcome" to the file.