
PHP Array and String MCQs

Quiz
•
Engineering
•
University
•
Medium

Mohit Mishra
Used 1+ times
FREE Resource
50 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
45 sec • 2 pts
Which function is used to count the number of elements in an array?
count()
sizeof()
length()
Both A and B
2.
MULTIPLE CHOICE QUESTION
45 sec • 2 pts
What will be the output of the following code? $arr = array("Apple", "Banana", "Mango"); echo $arr[1];
Apple
Banana
Mango
Error
3.
MULTIPLE CHOICE QUESTION
45 sec • 2 pts
Which function is used to merge two or more arrays in PHP?
array_combine()
array_merge()
array_union()
array_connect()
4.
MULTIPLE CHOICE QUESTION
45 sec • 2 pts
What does the array_keys() function return?
Only numeric keys
Only string keys
An array of all keys from an array
A string of all keys
5.
MULTIPLE CHOICE QUESTION
45 sec • 2 pts
Which function removes the last element from an array?
array_shift()
array_pop()
array_unset()
array_remove()
6.
MULTIPLE CHOICE QUESTION
45 sec • 2 pts
What will be the output of the following code? $arr = array(1 => "One", 2 => "Two", 3 => "Three"); print_r(array_values($arr));
Array ( [0] => One [1] => Two [2] => Three )
Array ( [1] => One [2] => Two [3] => Three )
Array ( [0] => Two [1] => Three [2] => One )
Error
7.
MULTIPLE CHOICE QUESTION
45 sec • 2 pts
How do you check if a key exists in an associative array?
isset()
array_key_exists()
in_array()
key_exists()
Create a free account and access millions of resources
Similar Resources on Wayground
50 questions
FE1prf192

Quiz
•
University
55 questions
8.1.1 - Principles of Mechanical Engineering

Quiz
•
10th Grade - University
49 questions
E1-L2_Networking Models Quiz

Quiz
•
University
54 questions
Basic Electricity (MCHE)

Quiz
•
University
47 questions
DO NOT OPEN

Quiz
•
University
50 questions
Python and C Programming Quiz

Quiz
•
University
50 questions
Introduction to Python Quiz

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Engineering
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University