PHP Array and String MCQs

PHP Array and String MCQs

University

•

50 Qs

quiz-placeholder

Similar activities

Casting and Moulding Quiz (MES unit 3)

Casting and Moulding Quiz (MES unit 3)

University

•

50 Qs

Quiz Teknik Tegangan Tinggi

Quiz Teknik Tegangan Tinggi

University

•

50 Qs

Johnson Controls India Assessment Test 02

Johnson Controls India Assessment Test 02

University

•

50 Qs

Diagnostics Test 01 in Thermodynamics

Diagnostics Test 01 in Thermodynamics

University

•

50 Qs

TICE Lab Quiz 2025

TICE Lab Quiz 2025

University

•

50 Qs

Final Examination in MATH 153 - Part 3 (Elements)

Final Examination in MATH 153 - Part 3 (Elements)

University

•

50 Qs

Unit 3.2 – Pumps

Unit 3.2 – Pumps

University

•

47 Qs

MID SEMESTER ENGLISH ENGINEER

MID SEMESTER ENGLISH ENGINEER

University

•

50 Qs

PHP Array and String MCQs

PHP Array and String MCQs

Assessment

Quiz

•

Engineering

•

University

•

Practice Problem

•

Medium

Created by

Mohit Mishra

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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()

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?