adplus-dvertising
frame-decoration

Question

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) );
    ?>

a.

True

b.

1

c.

False

d.

2

Answer: (d).2

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the following PHP code?

Similar Questions

Discover Related MCQs

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

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

Q. 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”);

Q. PHP’s numerically indexed array begin with position ___________

Q. A function in PHP which starts with __ (double underscore) is know as..

Q. Which of the following are valid function names?

i) function()
ii) €()
iii) .function()
iv) $function()

Q. Type Hinting was introduced in which version of PHP?

Q. Which one of the following is the right way of defining a function in PHP?

Q. Three ways to create an array is Direct assignment, array ( ) construct and

Q. Multidimensional arrays are simple arrays that have

Q. Other than index values an array can be retrieved by a function that is called as

Q. As compared to associative arrays vector arrays are much

Q. In vector arrays, the elements must have

Q. $multi_array [1] [2] [3] [4] = "I am working on PHP"; will create

Q. Next ( ) function returns value after the

Q. A function that takes two integers as arguments and returns an array filled with all integers between them, is known as

Q. Foreach ( ), current ( ), next ( ), reset ( ), each ( ) and array_walk ( ) all these functions are example of

Q. Default numbering for an array indices starts from

Q. For getting rid of an assigned variable in an array which function is used?

Q. Unlike vector arrays of C and C++ PHP arrays can store