
PHP - Array

Quiz
•
Computers
•
University
•
Hard

Sin Chee L
Used 46+ times
FREE Resource
8 questions
Show all answers
1.
FILL IN THE BLANK QUESTION
1 min • 1 pt
PHP’s numerically indexed array begin with position ___________
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following are CORRECT ways of creating an array?
i ) disease[0] = "covid19";
ii) $disease[] = array("covid19");
iii) $disease[0] = "covid19";
iv) $disease = array("covid19");
iii) and iv)
Only iii)
Only iv)
ii) and iii)
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following PHP function will return true if a variable is an array or false if it is not an array?
this_array()
is_array()
do_array()
in_array()
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which in-built function will add a value to the end of an array?
array_unshift()
into_array()
inend_array()
array_push()
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following PHP code?
<?php
$diseases = array ("SARS", "STDs", "Covid19");
echo (next($diseases));
echo (next($diseases));
?>
STDsCovid19
SARSCovid19
SARSSTDs
Covid19SARS
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following function is used to get the value of the previous element in an array?
last()
before()
prev()
previous()
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following PHP code?
<?php
$vege = array ("avocado", "broccoli", array ("cabbage", "eggplant"), "fig");
echo (count($vege, 1));
?>
_________________________________________________________
The function count() will return the number of elements in an array. The parameter 1 counts the array recursively i.e it will count all the elements of multidimensional arrays.
2
4
5
6
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which function returns an array consisting of associative key/value pairs?
count()
array_count()
array_count_values()
count_values()
Similar Resources on Wayground
11 questions
11 câu trắc nghiệm PHP

Quiz
•
University
10 questions
Laravel True or False Quiz 1

Quiz
•
University
10 questions
Arrays in C (II yr 02.07.2020)

Quiz
•
University
12 questions
Pretes Pertemuan ke 3

Quiz
•
University
10 questions
Pemrograman Web

Quiz
•
University
10 questions
C Program Array and strings

Quiz
•
University
10 questions
Css

Quiz
•
University
10 questions
untitled

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

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

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

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

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University