This document contains questions from 5 chapters about PHP programming. It includes questions about PHP features like loops, arrays, object-oriented programming, forms, sessions, cookies, and connecting to MySQL databases. Example code is provided for many questions to demonstrate the discussed PHP concepts.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
634 views6 pages
Question Bank
This document contains questions from 5 chapters about PHP programming. It includes questions about PHP features like loops, arrays, object-oriented programming, forms, sessions, cookies, and connecting to MySQL databases. Example code is provided for many questions to demonstrate the discussed PHP concepts.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6
Question Bank
CHAPTER 1
1. Describe advantages of PHP.
2. List any four advantages of PHP? 3. State the use of “$” sign in PHP. 4. Write syntax of PHP 5. Write down rules for declaring PHP variable 6. Explain different loops in PHP with example. 7. List any four data types of PHP. 8. Write syntax of for each loop 9. Explain the use of break and continue statements. 10.Describe the syntax of if-else control statement with example in PHP. 11.Write a PHP program to display numbers from 1-10 in a sequence using for loop. 12.Write a program using foreach loop. 13.Explain any three data types used in PHP. 14.Define the use of foreach loop in php. 15.State any 2 difference between for and for each. 16.Explain the use of break and continue statement. 17.List loop control structures. Explain any one loop control structure. 18.Explain the following terms:(i) Variables(ii) Datatypes(iii) Constant(iv) Operators
CHAPTER 2
1. What is array? How to store data in array?
2. List different types of arrays. 3. State the use of str_word_count along with its syntax. 4. Explain Indexed and Associative arrays with suitable example. 5. Write a program to create associative array in PHP. 6. Define function. How to define user defined function in PHP? Give example. 7. Write PHP script to sort any five numbers using array function. 8. Explain any four string functions in PHP with example 9. Define Array. State its example. 10.Explain Indexed array and associative arrays with suitable examples. 11.Explain two functions to scale the given image. 12.Define user defined function with example 13.Write a PHP program to i) Calculate length of string ii) Count number of words in string i) Calculate length of string 14.Differentiate between implode and explode functions 15.State the variable function.Explain it with example. 16.Write a program to create PDF document in PHP. 17.Differentiate between Implode and Explode functions. 18.Write the use of array_flip() 19.Define ImageColorAllocate() function along with itssyntax 20.Describe the creation of PDF document in PHP. 21.Explain the following string functions with example.
22.Explain the concept of anonymous function in detail.
23. Write a program to create a filled rectangle. 24.List Different types of array 25.Explain functions. List its types. 26.Explain procedure to create PDF in PHP. Write example. 27.Explain the operations on string: (i) strrev()(ii) strpos() 28.List string function in PHP. Explain any two. 29.Develop a PHP program without using string functions: (i) To calculate length of string (ii) To count the number of words in string
CHAPTER 3
1. List types of inheritance.
2. Explain method overloading with example 3. Define Introspection and explain it with suitable example 4. Write PHP program for cloning of an object 5. Describe the Introspection method in detail 6. Create a class as “Percentage” with two properties length & width. Calculate area of rectangle for two objects. 7. What is inheritance? 8. State the role of constructor. 9. Write syntax to create class and object in PHP 10.Write a program for cloning of an object 11.State the use of cloning of an object. 12.Illustrate class inheritance in PHP with example 13.Explain the concept of overriding in detail. 14.Explain cloning object. 15.Explain class and object creation. 16.Develop a PHP program for overriding. 17.Explain constructor and destructor in PHP. 18.Write a PHP program on Introspection. 19.Develop a PHP program to create constructor to initialize object of class
CHAPTER 4
1. How can we destroy cookies
2. How to create session variable in PHP? 3. Write difference between get() and post() method of form (Any four points) 4. Define session and cookie. Explain use of session start. 5. Create customer form like customer name, address, mobile no, date of birth using different form of input elements & display user inserted values in new PHP form 6. How do you validate user inputs in PHP. 7. Create a web page using GUI components. 8. Write a PHP program to demonstrate use of cookies. 9. State the use of cookies 10.Explain web page validation with example 11. Define session and explain how it works. 12.State role of GET and POST methods 13.Describe i) Start session ii) Get session variables 14.State any four form controls to get user’s input in PHP 15.Answer the following i)Use of cookies ii) how to set the cookie iii) how to modify iv) how to delete the cookies. 16. Describe the web page validation with suitable example. 17. Differentiate between Session and Cookies. 18.Write the syntax for creating Cookie. 19.Define GET and POST methods. 20.Write a PHP program to demonstrate session management. 21.Answer the following: i) Get session variables ii) Destroy session 22.Write steps to create webpage using GUI components. 23.Write a PHP program to set and modify cookies 24.Define theGET and POST methods. 25.List attributes of cookie.
26.Differentiate between session and cookies.
27.Develop a simple program for sending and receiving plain text message. 28.Define the following terms: i) Start a session ii) Destroy a session
Design a web page using following form controls:
(i) Radio Button (ii) Checkbox
CHAPTER 5
1. Write syntax of Connecting PHP Webpage with MySQL`
2. Write update operation on table data. 3. List any four data types in MYSQL 4. Explain delete operation of PHP on table data 5. Inserting and retrieving the query result operations 6. How do you connect MYSQL database with PHP. 7. List two database operations 8. Write steps to create database using PHP 9. Explain queries to update and delete data in the database. 10.Write a program to connect PHP with MYSQL. 11.State the use of serialization. ii) State the query to insert data in the database 12.Define serialization. 13.Write Update and Delete operations on table data 14.Explain Inserting and Retrieving the query result operations. 15.Explain the concept of Serialization with example. 16.Write a program to connect PHP with MySQL. 17.Elaborate the following: i) __call() ii) mysqli_connect() 18.Define the uses of serialize() and unserialize(). 19.List out the database operations 20.Write a program by using mysqli_connect(). 21.Define MySQL. 22.Develop a program to connect PHP with MySQL.. 23.Explain update and delete operations on table data. 24.Develop a PHP program to (i) Enter data into database (ii) Retrieve and present data from database 25.Explain the following: (i) POD: construct() (ii) mysqli connect()
(a)
Develop a PHP program without using string functions: