All India Exams
  • Sign In / Register Sign In
Home AptitudeBankEngineeringEnglishGKInterviewOnline TestPlacement PapersReasoning
  • Home
  • Aptitude
  • Bank
  • Engineering
  • English
  • GK
  • Interview
  • Online Test
  • Placement Papers
  • Reasoning

Arrays Questions And Answers

Here you can find Arrays Questions and Answers.

Why Arrays Questions and Answers Required?

In this Arrays Questions and Answers section you can learn and practice Arrays Questions and Answers to improve your skills in order to face technical inerview conducted by organisations. By Practicing these interview questions, you can easily crack any Exams interview.

Where can I get Arrays Questions and Answers?

AllIndiaExams provides you lots Arrays Questions and Answers with proper explanation. Fully solved examples with detailed answer description. All students, freshers can download Arrays Questions and Answers as PDF files and eBooks.

How to solve these Arrays Questions and Answers?

You no need to worry, we have given lots of Arrays Questions and Answers and also we have provided lots of FAQ's to quickly answer the questions in the Competitive Exams interview.

Arrays Questions & Answers

1. PHP’s numerically indexed array begin with position __.

Arrays Questions & Answers

2. Which of the functions is used to sort an array in descending order?

Arrays Questions & Answers

3. Which of the following are correct ways of creating an array? (i) state[0] = “karnataka”; (ii) $state[] = array(“karnataka”); (iii) $state[0] = “karnataka”; (iv) $state = array(“karnataka”);

Arrays Questions & Answers

4. What will be the output of the following PHP code? < ?php $fruits = array ("mango", "apple", "pear", "peach"); $fruits = array_flip($fruits); echo ($fruits[0]); ?>

Arrays Questions & Answers

What will be the output of the following php code? < ?php $states = array("karnataka" => array ( "population" => "11,35,000", "captial" => "Bangalore"), "Tamil Nadu" => array( "population" => "17,90,000", "captial" => "Chennai") ); echo $states["karnataka"]["population"]; ?>

Arrays Questions & Answers

6. Which function will return true if a variable is an array or false if it is not?

Arrays Questions & Answers

7. Which in-built function will add a value to the end of an array?

Arrays Questions & Answers

8. What will be the output of the following PHP code? < ?php $state = array ("Karnataka", "Goa", "Tamil Nadu", "Andhra Pradesh"); echo (array_search ("Tamil Nadu", $state) ); ?>

Arrays Questions & Answers

9. What will be the output of the following PHP code? < ?php $fruits = array ("apple", "orange", "banana"); echo (next($fruits)); echo (next($fruits)); ?>

Arrays Questions & Answers

10. Which function can be used to move the pointer to the previous array position?

Home EngineeringComputer Science & EngineeringPHP Questions and AnswersArrays

Arrays - PHP Questions and Answers

This is the questions and answers section on "PHP Arrays" with explanation for various interview, competitive examination and entrance test. Solved examples with detailed answer description, explanation are given and it would be easy to understand. Here, aspirants can read the PHP Arrays related Interview Questions and Answers. The provided PHP Arrays Online Test contains popular and frequently asked interview questions. The contenders can practice the PHP Arrays Quiz and know the various types of questions and answers. So, the applicants can go through all the sections which are arranged on this page to get information about the PHP Arrays Mock Test. All the postulates who are preparing for the various exams and interviews regarding PHP can check out this PHP Arrays Interviews Questions and Answers. In addition to this, the applicants can find the multiple choice questions related to the Arrays in PHP on this page.



PHP Arrays Questions - PHP Arrays Quiz Details

Online Test Name Arrays
Exam Type Multiple Choice Questions
Category Computer Science Engineering Quiz
Number of Questions 16


The applicants need to know about the Arrays in PHP by practicing the PHP Arrays Questions from this article. Array in PHP is a type of data structure that allows the users to store multiple elements of similar data type under a single variable thereby saving the effort of creating a different variable for every data. There are 3 types of arrays in Hypertext Preprocessor like Indexed or Numeric Arrays - An array with a numeric index where the values are stored linearly. Associative Arrays - An array with a string index where instead of the extended storage, each value can be assigned a specific key. Multidimensional Arrays - An array which contains the single or multiple arrays within it and can be accessed through various indices.



PHP Arrays Multiple Choice Questions

The provided PHP Arrays Multiple Choice Questions are asked in the previous examinations and interviews. By practicing the PHP Arrays Online Test, the contenders can easily answer all the questions at the time of the examinations. Therefore, without any delay, the candidates need to take part in the PHP Arrays Quiz to gather the different questions and answers. Scroll down the page and prepare for the tests based on the provided PHP Arrays Mock Test. Follow our website that is Allindiaexams.in and check more online tests.

Arrays MCQ Quiz Answers with Solutions

The explanation for the PHP Arrays Questions is provided in this article. The contenders who are eager to know all the points related to the Arrays in PHP can refer to this post. By knowing all the primary points about the Arrays in PHP, the students can easily score the marks in the tests. To, know the answer along with the explanation for the PHP Arrays Questions, the candidates need to click on the View Answer button. We think the given PHP Arrays Online Test is useful to all the applicants to prepare for the examinations.


1. PHP’s numerically indexed array begin with position __.
  • A. 1
  • B. 2
  • C. 0
  • D. -1
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option C

Explanation:

Like many programming languages, the first element of an array has an index value of 0.

Workspace

Report Error


2. Which of the functions is used to sort an array in descending order?
  • A. sort()
  • B. asort()
  • C. rsort()
  • D. dsort()
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option C

Explanation:

sort() function is used to sort in ascending order where as rsort() meaning reverse sort is used for sorting in descending order.

Workspace

Report Error


3. Which of the following are correct ways of creating an array?
(i) state[0] = “karnataka”;
(ii) $state[] = array(“karnataka”);
(iii) $state[0] = “karnataka”;
(iv) $state = array(“karnataka”);
  • A. (iii) and (iv)
  • B. (ii) and (iii)
  • C. Only (i)
  • D. (ii), (iii) and (iv)
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option A

Explanation:

A variable name should start with $ symbol which is not present in i) and you need not put the square brackets when you use the array() constructor.

Workspace

Report Error


4. What will be the output of the following PHP code?
< ?php 
    $fruits = array ("mango", "apple", "pear", "peach");
    $fruits = array_flip($fruits);
    echo ($fruits[0]);
?>
  • A. mango
  • B. Error
  • C. peach
  • D. 0
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option B

Explanation:

As we are flipping the values, $fruits["mango"] = 0, $fruits["apple"] = 1 and so on.

Workspace

Report Error


5. What will be the output of the following php code?
< ?php 
    $states = array("karnataka" => array
    ( "population" => "11,35,000", "captial" => "Bangalore"),
    "Tamil Nadu" => array( "population" => "17,90,000",
    "captial" => "Chennai") );
    echo  $states["karnataka"]["population"];
?>
  • A. karnataka 11,35,000
  • B. 11,35,000
  • C. population 11,35,000
  • D. karnataka population
  • View Answer
  • Workspace
  • Report
  • Discuss

Answer & Explanation

Answer: Option B

Explanation:

Treat states as a multidimensional array and accordingly traverse it to get the value.

Workspace

Report Error


  • «
  • 1
  • 2
  • 3
  • 4
  • »

Related Topics:

  • Functions
  • Variables
  • Strings & Regular Expressions
  • HTML Forms
  • MySQL Basics
  • PHP Basics
  • Exception Handling
  • Object Oriented PHP

Mock Tests & Online Quizzes

  • Aptitude Online Test

  • Reasoning Online Test

  • GK Online Test

  • English Online Test

  • RRB Mock Test

  • RBI Mock Test

  • Free SBI Mock Test

  • IBPS Mock Test FREE

  • SSC Mock Test

  • CAT Exam Mock Test

  • GATE Mock Test

  • LIC Mock Test Series

  • MAT Mock Test

  • SEBI Mock Test

  • ESIC Mock Test

  • IT Courses Quiz

Newsletter

Contact Us

Questions and Answers

  • Aptitude Questions
  • Verbal Reasoning Questions
  • Non Verbal Reasoning Questions
  • Logical Reasoning Questions
  • Data Sufficiency Questions
  • Data Interpretation Questions
  • C Programming
  • C++ Programming
  • PHP Programming
  • Java Programming
  • eLitmus Sample Papers
  • ECE Questions and Answers
  • EEE Questions and Answers
  • Verbal Ability Questions
  • GK Questions
  • AMCAT Mock Online Test
  • LIC Mock Test
  • IBPS Mock Test

Interview Questions

  • Java Interview Questions
  • .Net Interview Questions
  • Networking Interview Questions
  • C Language Interview Questions
  • C++ Interview Questions
  • Testing Interview Questions
  • Android Interview Questions
  • HR Interview Questions
  • Group Discussion Topics
  • iOS Interview Questions
  • Web Technologies
  • Database Interview Questions
  • MS Office Interview Questions
  • Software Tools
  • Data Interpretation
  • PHP Interview Questions
  • CAT Mock Test
  • SSC Mock Test
© by AllIndiaExams.in. All Rights Reserved | Copyright | Terms of Use & Privacy Policy