Write a PHP program for illustrating the starting and ending of session. [5]
Debugging PHP
1.
What is error handler? Write a PHP program to show use of error handler to format and print errors. [5]
File Handling
1.
For the following JSON file named BIT.JSON, write a PHP program to read information from this JSON file: {Name: "Gunadi", Email: "Gunadi@gmail.com", Dob: "January 1", Age: 30} [5]
Handling Forms
1.
Consider you have a login form having username, password fields, login and cancel buttons. Now, write a PHP program for implementing login event. The login should be redirected to home.php upon successful login button event. The cancel button should clear the form field values upon its submission. [10]
2.
How can you retrieve the form data? Illustrate with example. [5]
Introduction
1.
What are variables? How can you define static variables? Write a PHP program to illustrate the use of Switch statement. [10]
2.
How are comments written in PHP? Write a PHP program that will read your name and roll number and print the values. Label your program with appropriate comments. [5]
Objects
1.
Describe an anonymous class using suitable example. [5]
Strings and Arrays
1.
How can you store string type data in an array? Write a PHP program to illustrate use of extract and compact functions for conversion between arrays and variables. [10]
2.
Write a PHP program that will contain a concat string function. The function should have two arguments st1 and st2 of type string and should return st3 which is concatenation of st1 and st2. [5]
3.
Write a PHP program to extract subset of a string array using array_slice() function. [5]