Vidyalelo
PHP · Q30

Arrays

Programming · PHP · question 30

Q30

What will be the output of the following PHP code?

A.
Array ( Peter Ben Joe )
B.
Array ( [Peter] => 35 [Ben] => 37 [Joe] => 43 )
Answer
C.
Array ( 35 37 43 )
D.
Array ( “[Peter] => 35” “[Ben] => 37” “[Joe] => 43” )

Answer: Option B

Solution

Answer: Option B
Solution:
The array_combine() function creates an array by using the elements from one “keys” array and one “values” array.