0% found this document useful (0 votes)
2 views

QB

The document is a comprehensive question bank focused on PHP and CodeIgniter, covering a wide range of topics such as operators, file handling, MVC architecture, database connectivity, and error handling. It includes practical programming tasks, explanations of key concepts, and comparisons of different PHP frameworks. The questions aim to assess knowledge and skills in PHP programming and the use of the CodeIgniter framework.
Copyright
© © All Rights Reserved
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% found this document useful (0 votes)
2 views

QB

The document is a comprehensive question bank focused on PHP and CodeIgniter, covering a wide range of topics such as operators, file handling, MVC architecture, database connectivity, and error handling. It includes practical programming tasks, explanations of key concepts, and comparisons of different PHP frameworks. The questions aim to assess knowledge and skills in PHP programming and the use of the CodeIgniter framework.
Copyright
© © All Rights Reserved
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/ 5

Question Bank PHP:

1. Describe the different types of operators available in PHP.


2. Create a PHP program in CodeIgniter to generate and display a
multiplication table for a specific number using a do-while loop.
3. Write a script to define getter and setter methods for a private property salary
in an Employee class, with validation in the setter to ensure the salary is not
negative.
4. Provide a PHP code example to read a file line by line using the
fgets() function.
5. Explain the file opening functions in PHP and write a code snippet
to demonstrate opening a file for random access.
6. Outline how URL routing operates in CodeIgniter and describe the structure
of its application URLs.
7. Demonstrate the use of PHP’s fgets() function to read a file line by line
with a code example.
8. Explain the following built-in PHP functions:
a. substr() strcmp() strnotcmp() strlen() strchr()
9. Write a PHP program to illustrate polymorphism by implementing
method overriding in classes.
10.Write a PHP code snippet to split a file path into the following components:

a. The directory path (e.g., /var/www/html/uploads).


b. The file name (e.g., myfile.txt).
c. The file name without the extension (e.g., myfile).

11.Explain the role of controllers in CodeIgniter and how data is passed to them.
12.Develop a PHP script to pass employee details from a controller and
display them on a view page in CodeIgniter.
13.Create a PHP code example to demonstrate the use of an anonymous function.
14.Write a program in PHP to illustrate the use of get() and
set() magic methods
for encapsulating access to private properties.
15.Provide examples of common file permissions such as read, write, and
execute, and explain how they are represented (e.g., rwx or numeric values
like 755).
16.Mention PHP functions like chmod() and chown().
17.Explain how PEAR DB handles database errors and demonstrate error
handling using the DB::isError() function.
18.Discuss the implementation of the MVC pattern in CodeIgniter with a
relevant example.
19.Define HTTP and explain the roles of a web server and a web browser with
the help of a diagram.
20.Identify the PHP function used to delete an element from an array.
21.Compare and contrast a class and an object in PHP. Explain how
constructors and destructors improve the functionality of classes.
22.Outline the process of performing Create, Read, Update, and Delete
(CRUD) operations in PHP using database queries.
23.Describe the URL routing mechanism in CodeIgniter and explain the
structure of application URLs.
24.Discuss the PHP functions available for storing data in arrays.
25.Explain the working of constructors and destructors in PHP with a
program demonstrating their functionality in a Person class.
26.Highlight the difference between fgets() and fread() functions for file
reading in PHP.
27.Provide an example to demonstrate how to read data from web form
controls like text boxes in PHP.
28.Explain the structure of a CodeIgniter application and the purpose of each
main directory.
29.Write a PHP script using echo, print, and printf to display formatted text
and numbers.
30.List and describe five commonly used file modes in PHP with their syntax.
31.Create a PHP class that demonstrates the use of static properties and
methods for shared functionality across objects.
32.Provide examples of performing database operations (SELECT,
INSERT, UPDATE, DELETE) using PEAR DB in PHP.
33.Explain the steps involved in implementing the MVC pattern in
CodeIgniter with an example.
34.Write a PHP program to define a base class Shape with a method getArea().
35.Create a derived class Rectangle that overrides the getArea() method to
calculate the area of a rectangle.
36.What is the use of $ symbol in PHP, explain with an example.
37.Explain database connectivity in PHP with reference to MYSQL.
38.Define Session and Cookies. Explain with an example program.
39.List and explain the Control structures used in PHP.
40.What are the benefits of using PEAR DB in PHP applications?
41.Define PDO and explain how it serves as an abstraction layer for working
with databases in PHP.
42.How to read data from web form control like Text boxes explain with
an example.
43.Define Session and Cookies. Explain with an example program.
44.Design a PHP script for uploading a file to the server and display the
uploaded files details.
45.Write PHP code for reading and writing characters in file.
46.What is connection pooling, and how can it improve performance?
47.List and explain the string functions in PHP
48.Explain how to manage transactions in PHP with commit, rollback,
and savepoints.
49.Write PHP code for creating connection with mysqli.
50.Why are prepared statements important for security and performance?
Provide examples using mysqli and PDO.
51.How does caching improve database performance? Discuss common
caching methods.
52.Write PHP code for reading a file line by line.
53.How to read data from web form control like Text boxes explain with
an example.
54.How does PEAR DB handle database errors? Demonstrate error handling
in PEAR DB using the DB::isError() function.
55.Explain file opening function. Write PHP code for opening the File
for Random Access.
56.Explain the key features of CodeIgniter and compare it with other
PHP frameworks.
57.Describe the MVC architecture in CodeIgniter and its benefits in
web development.
58.Explain the steps to install CodeIgniter and set up a basic project.

59.How do you create a model in CodeIgniter and interact with


the controller?
60.Explain how to configure a database connection and perform
queries using CodeIgniter.
61.Describe the main features of CodeIgniter and compare it to other
62.PHP frameworks.
63.Explain the MVC architecture in CodeIgniter and its advantages
in web development.
64.Outline the steps for installing CodeIgniter and creating a
basic project.
65.Explain the structure of a CodeIgniter application and the purpose
of each key directory.
66.Discuss how CodeIgniter implements the MVC pattern with
an example.
67.Describe how URL routing works in CodeIgniter and the structure
of application URLs.
68.How are controllers used in CodeIgniter, and how do you pass data
to them?
69.What is the role of a constructor in a CodeIgniter controller?
Provide an example.
70.Explain how to create a controller function and pass data to a view
in CodeIgniter.
71.How do you load a view and send dynamic data to it
from a controller?
72.How can you build and use a custom layout with sections like
header, footer, and content?
73.Explain how to pass parameters through URLs and use them
in controller methods.
74.How do you create a model in CodeIgniter and interact with it
from a controller?
75.Explain the process of setting up a database connection
and performing queries in CodeIgniter.

You might also like