Dynamic Web Page Development (3350702) MCQs

MCQs of Working with PHP Arrays and functions

Showing 1 to 10 out of 59 Questions
1.

PHP’s numerically indexed array begin with position ___________.

(PHP ની ન્યૂમેરિક index એરે ___________ positionથી શરૂ થાય છે.)

(a)

0

(b)

1

(c)

2

(d)

-1

Answer:

Option (a)

2.

Which of the following are correct ways of creating an array?

i) state[0] = "gujarat";

ii) $state[] = array("gujarat");

iii) $state[0] = "gujarat";

iv) $state = array("gujarat");

નીચેનામાંથી એરે create કરવાની યોગ્ય રીતો કઈ છે?

i) state[0] = "gujarat";

ii) $state[] = array("gujarat");

iii) $state[0] = "gujarat";

iv) $state = array("gujarat");

(a)

iii) and iv)

(b)

 ii) and iii)

(c)

Only i)

(d)

ii), iii) and iv)

Answer:

Option (a)

3.

What will be the output of the following PHP code?

(નીચેના PHP કોડનું આઉટપુટ શું હશે? )

(a)

 I like Volvo, Toyota and BMW

(b)

I like Volvo, BMW and Toyota

(c)

 I like BMW, Volvo and Toyota

(d)

I like Toyota, BMW and Volvo

Answer:

Option (d)

4.

Which function is used to return the length (the number of elements) of an array?

(એરેની length (એલિમેંટની સંખ્યા) રિટર્ન કરવા કયા ફંક્શનનો ઉપયોગ થાય છે?)

(a)

count()

(b)

length()

(c)

count_in()

(d)

number()

Answer:

Option (a)

5.

What will be the output of the following PHP code?

(નીચેના PHP કોડનું આઉટપુટ શું હશે?)

(a)

Array ( [0] => red [1] => green )

(b)

Array ( [0] => green [1] => blue )

(c)

Array ( [0] => red [1] => blue )

(d)

Array ( [0] => blue [1] => blue )

Answer:

Option (a)

6.

What will be the output of the following PHP code?

(નીચેના PHP કોડનું આઉટપુટ શું હશે?)

(a)

Array ( [1] => apple [0] => mango [2] => peach [3] => pear )

(b)

 Array ( [0] => apple [1] => mango [2] => peach [3] => pear )

(c)

Error

(d)

Array ( [1] => apple [0] => mango [3] => peach [2] => pear )

Answer:

Option (c)

7.

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

(ઉતરતા ક્રમમાં એરેને સોર્ટ કરવા માટે કયા ફંક્શનનો ઉપયોગ થાય છે?)

(a)

sort()

(b)

asort()

(c)

rsort()

(d)

dsort()

Answer:

Option (c)

8.

What will be the output of the following PHP code?

(નીચેના PHP કોડનું આઉટપુટ શું હશે?)

(a)

Error

(b)

 Array ( [0] => apple [1] => mango [2] => peach )

(c)

Array ( [0] => apple [1] => mango )

(d)

Array ( [0] => pear [1] => orange )

Answer:

Option (c)

9.

What will be the output of the following PHP code?

(નીચેના PHP કોડનું આઉટપુટ શું હશે?)

(a)

5

(b)

a

(c)

b

(d)

c

Answer:

Option (c)

10.

What will be the output of the following PHP code?

(નીચેના PHP કોડનું આઉટપુટ શું હશે?)

(a)

Match found

(b)

Match not found

(c)

2

(d)

Glenn

Answer:

Option (b)

Showing 1 to 10 out of 59 Questions