1. Home
  2. Computer Science MCQs
  3. PHP
  4. What is the correct way to create an array in PHP?

Added 20 Jan 2024

What is the correct way to create an array in PHP?

  1. arr()
  2. array() Correct answer
  3. arr = []
  4. array = ()

Correct answer

B. array()

18 views

MCQSEXAM

Explanation

Arrays in PHP can be created using the array() function or [].

Reference

Asked in: PHP Certification

https://www.php.net/manual/en/language.types.array.php

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More PHP MCQs

Practise all PHP MCQs

Similar MCQs