thumbnail

PHP Quiz for dummies #3

Easy PHP questions #3
Quiz by textreader
Rate:
Last updated: March 15, 2024
You have not attempted this quiz yet.
First submittedMarch 14, 2024
Times taken5
Average score73.3%
Report this quizReport
5:00
The quiz is paused. You have remaining.
Scoring
You scored / = %
This beats or equals % of test takers also scored 100%
The average score is
Your high score is
Your fastest time is
Keep scrolling down for answers and more stats ...
1. PHP is Scripting language
Brower Side
Server Side
Home Side
Client Side
2. What function do you use in PHP in order to access MySQL?
mysqlconnect()
mysql_connect()
sql_connect()
3. Which of the following is correct for PHP variables?
Variables can, but do not need, to be declared before assignment
Variables in PHP do not have intrinsic types - a variable does not know in advance whether it will be used to store a number or a string of characters.
Variables used before they are assigned have default values.
All of the above.
4. Which of the following type of variables have only two possible values either true or false?
Boolean
Integer
Double
String
5. Which of the following magic constant of PHP returns function name?
_FUNCTION_
_CLASS_
_NAME_
_FILE_
6. Which of the following keyword terminates the for loop or switch statement and transfers execution to the statement immediately following the for loop or switch?
Break
Continue
7. Which of the following function returns selected parts of an array?
array_reverse();
array_split();
array_slice();
array_part();
8. Can you assign the default values to a function parameters?
True
False
9. Which of the following is correct about preg_match() function?
The preg_match() function searches a string specified by string for a string specified by pattern, returning true if the pattern is found, and false otherwise.
The preg_match() function searches throughout a string specified by pattern for a string specified by string. The search is not case sensitive.
The preg_match() function searches string for pattern, returning true if pattern exists, and false otherwise.
10. Select the correct code to create a associative array in PHP
$student = array( "name" => "Swagata Mondal", "age" => 21, "stream" => "Computer Science" );
$student["name"] = "Golf green"; $student["age"] = 21; $student["stream"] = "Computer Science";
Both of the above.
None of the above.
11. The (2>0 || 4>5) condition will return what in PHP
True
False
12. The (2>0 && 4>5) condition will return what in PHP
True
False
13. What is the purpose of the 'session_start()' function in PHP?
Initializes session variables
Starts new or resume existing session
Starts a new server session
Ends a session
14. What does the 'PDO' stand for in PHP?
Persistent Data Object
PHP Database Object
Program Data Orientation
Public Data Object
15. In PHP, which function is used to convert a JSON string into a PHP variable?
json_convert()
json_parse()
decode_json()
json_decode()
Comments
No comments yet