PHP CodeIgniter MCQ Questions & Answers
CodeIgniter MCQs : This section focuses on "CodeIgniter" PHP Framework. These Multiple Choice Questions (MCQ) should be practiced to improve the PHP CodeIgniter skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. Which of the following is true about CodeIgniter?
A. CodeIgniter is an application development framework
B. CodeIgniter can be used to develop websites, using PHP.
C. CodeIgniter is an Open Source framework
D. All of the above
View Answer
Ans : D
Explanation: CodeIgniter is an application development framework, which can be used to develop websites, using PHP. It is an Open Source framework. It has a very rich set of functionality, which will increase the speed of website development work.
2. CodeIgniter directory structure is divided into?
A. 2 folders
B. 3 folders
C. 4 folders
D. 5 folders
View Answer
Ans : B
Explanation: CodeIgniter directory structure is divided into 3 folders : Application, System, User_guide.
3. The __________ serves as an intermediary between the Model, the View, and any other resources needed to process the HTTP request and generate a web page.
A. Model
B. View
C. Controller
D. All of the above
View Answer
Ans : C
Explanation: The Controller serves as an intermediary between the Model, the View, and any other resources needed to process the HTTP request and generate a web page.
4. Model classes are stored in __________ directory.
A. application/models
B. helpers/models
C. app/models
D. system/models
View Answer
Ans : A
Explanation: Model classes are stored in application/models directory
5. In Routing, which segment represents the controller class that should be invoked?
A. First
B. Second
C. Third
D. Fourth
View Answer
Ans : A
Explanation: The first segment represents the controller class that should be invoked.
The second segment represents the class function, or method, that should be called.
The third, and any additional segments, represent the ID and any variables that will be passed to the controller.
6. Which of the following will specify location of your database here e.g. localhost or IP address?
A. database
B. username
C. hostname
D. dbdriver
View Answer
Ans : C
Explanation: hostname : Specify location of your database here e.g. localhost or IP address
7. Which function is used to select a record?
A. put()
B. select()
C. set()
D. get()
View Answer
Ans : D
Explanation: GET() function is used to select a record
8. The set() function will set the data to be updated.
A. TRUE
B. FALSE
C. Can be true or false
D. Can not say
View Answer
Ans : A
Explanation: To update a record in the database, the update() function is used along with set() and where() functions. The set() function will set the data to be updated.
9. Which class provides two-way data encryption functionality?
A. Config Class
B. Encryption Class
C. Email Class
D. Form Validation
View Answer
Ans : B
Explanation: Encryption Class : This class provides two-way data encryption functionality.
10. Which function displays errors in HTML format at the top of the screen?
A. show_error()
B. show_404()
C. log_message()
D. $level
View Answer
Ans : A
Explanation: show_error() function displays errors in HTML format at the top of the screen.
Discussion