PHP Questions
Unit 1:
2 mark Questions
1. List any four advantages of PHP
2. Write a program using For each loop.
3. State any 2 difference between for and for each
4. State the use of “$” sign in PHP.
5. Write syntax of PHP.
6. List any four data types in PHP
4 mark Questions
1. Write down rules for declaring PHP variable.
2. Explain decision making statements along with their syntax in PHP
3. Explain the use of break and continue statement.
4. Explain the use of break and continue statement.
5. Write a program using do-while loop.
6. Write down rules for declaring PHP variable.
7. Explain different loops in PHP.
Unit 2:
2 mark Questions
1. State the use of str-word-count along with its syntax.
2. List different types of arrays.
3. Explain functions. List its types.
4. What is array ? How to store data in array ?
5. State the use of strlen() & strrev().
4 mark Questions
1. Differentiate between implode & explode functions.
2. Write a program to create PDF document in PHP.
3. Explain the following string functions with example : (i) Str-replace (ii) Strlen( )
4. Explain the operations on string : (i) strrev( ) (ii) strpos( )
5. List string function in PHP. Explain any one in detail.
6. Explain associative and multi-dimensional arrays.
7. State user defined function and explain it with example.
8. Write a program to create associative array in PHP.
9. Write PHP script to sort any five numbers using array function.
Unit 3:
2 mark Questions
1. Explain class and object creation
2. Explain what is constructor and destructor with it’s syntax.
4 mark Questions
1. Explain the concept of constructor and destructor in detail.
2. Create a class as “Percentage” with two properties length & width. Calculate area of rectangle for two objects.
3. Explain constructor and destructor in PHP.
4. Explain constructor with example.