0% found this document useful (0 votes)
5 views3 pages

Quiz II FSP

The document contains a series of multiple-choice questions related to PHP, including topics such as variable types, operators, arrays, form handling, and AJAX. Each question is associated with specific course outcomes (CO) and program outcomes (PO). Additionally, there is a distribution table showing the allocation of questions across different COs and POs.

Uploaded by

Karthikeyini S
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)
5 views3 pages

Quiz II FSP

The document contains a series of multiple-choice questions related to PHP, including topics such as variable types, operators, arrays, form handling, and AJAX. Each question is associated with specific course outcomes (CO) and program outcomes (PO). Additionally, there is a distribution table showing the allocation of questions across different COs and POs.

Uploaded by

Karthikeyini S
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/ 3

Q.

No Question Options Answer CO PO


a) Client-side
b) Server-side
1 PHP is a _______ language. b CO1 PO1
c) Markup
d) Styling
a) typeof()
Which function is used to check b) gettype()
2 b CO1 PO1
variable type in PHP? c) type()
d) checktype()
a) "255"
What will (string)25 + 5 b) 30
3 b CO1 PO2
evaluate to in PHP? c) Error
d) 255
a) &&
Which of the following is a b) !==
4 b CO1 PO1
comparison operator? c) ++
d) .=
a) +
Which operator is used for string b) &
5 c CO1 PO1
concatenation in PHP? c) .
d) *
a) array("A", "B")
How do you define an indexed b) array("a" => "A", "b" => "B")
6 a CO2 PO2
array? c) [1 => "A", 2 => "B"]
d) all of the above
a) size()
Which function returns the b) length()
7 c CO2 PO2
number of elements in an array? c) count()
d) total()
a) 0
What is the result of b) 1
8 d CO2 PO2
strcmp("hello", "Hello")? c) -1
d) Depends on case sensitivity
a) preg_match()
Which function performs pattern b) regex_match()
9 a CO2 PO2
matching using regex? c) pattern_match()
d) match()
a) false
preg_match("/[0-9]{3}/", b) true
10 "123abc") returns:
c CO2 PO2
c) 1
d) 0
a) Cookies
b) Session data
11 $_POST is used to access: c CO3 PO2
c) Form data (POST)
d) Query string
a) method
What attribute must a form have b) action
12 d CO3 PO3
to send data to PHP? c) enctype
d) Both a and b
Q.No Question Options Answer CO PO
a) isset()
Which method is used to b) isvalid()
13 a CO3 PO3
validate form data? c) validate()
d) valid_form()
a) htmlentities()
PHP function to escape special b) escape()
14 a CO3 PO2
characters in form inputs: c) remove_tags()
d) encode_specials()
a) mysqli_connect()
Which PHP function connects to b) connect_db()
15 a CO4 PO3
MySQL using mysqli? c) db_connect()
d) mysql_open()
a) mysqli_fetch_data()
How do you fetch rows from b) fetch_row()
16 c CO4 PO3
MySQL in PHP? c) mysqli_fetch_assoc()
d) row_data()
a) Use POST
b) Use
A good practice to prevent SQL
17 mysqli_real_escape_string() b CO4 PO2
injection is:
c) Use cookies
d) Encrypt SQL
a) Server-side session
b) A file stored on client-side
18 What is a cookie in PHP? b CO5 PO1
c) A database row
d) A browser extension
a) create_cookie()
b) cookie_make()
19 Syntax to create a cookie: c CO5 PO5
c) setcookie()
d) set_cookie()
a) Browser closes
b) Time set in cookie
20 Cookies are stored until: d CO5 PO5
c) User clears cache
d) All of the above
a) Asynchronous Java App
Extension
b) Advanced Javascript and XML
21 AJAX stands for: c CO5 PO5
c) Asynchronous Javascript and
XML
d) Auto JSON Application XML
a) XMLLoader
Which object is used in AJAX b) XMLHttpRequest
22 b CO5 PO5
for HTTP requests? c) AJAXObject
d) RequestHandler
a) Send GET request to data.php
xhr.open("GET",
asynchronously
23 "data.php", true); means:
b) Open a database a CO5 PO5
c) Send POST data
d) None
Q.No Question Options Answer CO PO
a) Page reload
b) Server restart
24 AJAX is used for: c) Updating content without c CO5 PO5
reloading page
d) Server shutdown
a) xhr.load()
What triggers an b) xhr.connect()
25 c CO5 PO5
XMLHttpRequest send? c) xhr.send()
d) xhr.data()

📊 CO-Wise Distribution:

CO Questions
CO1 Q1–Q5
CO2 Q6–Q10
CO3 Q11–Q14
CO4 Q15–Q17
CO5 Q18–Q25

📊 PO-Wise Distribution:

PO Questions
PO1 Q1, Q2, Q4, Q18
PO2 Q3, Q6, Q9, Q14, Q17
PO3 Q12, Q13, Q15, Q16
PO5 Q19–Q25
PO9 Can be evaluated in practical/team projects

You might also like