1. What function computes the difference of arrays?
Correct : A. array_diff
2. What functions count elements in an array?
Correct : A. Count
3. There are three different kind of arrays:
Correct : C. Numeric array, Associative array, Multidimensional array
4. Which array function checks if the specified key exists in the array
Correct : B. array_key_exists()
5. Which of the following DBMSs do not have a native PHP extension?
Correct : D. None of the above
6. In PHP in order to access MySQL database you will use:
Correct : C. mysql_connect() function
7. PHP files have a default file extension of..
Correct : C. .php
8. Which of the following is/are a PHP code editor?
i) Notepad ii) Notepad++ iii) Adobe Dreamweaver iv) PDT
Correct : B. Only iii)
9. Which version of PHP introduced Try/catch Exception?
Correct : B. PHP 5
10. We can use ___ to comment a single line?
i) /? ii) // iii) # iv) /* */
Correct : C. ii), iii) and iv)
11. Which of the below statements is equivalent to $add += $add ?
Correct : B. $add = $add +$add
12. Which of the below symbols is a newline character?
Correct : B. \n
13. Which of the conditional statements is/are supported by PHP?
i) if statements
ii) if-else statements
iii) if-elseif statements
iv) switch statements
Correct : D. All of the above
14. Which of the looping statements is/are supported by PHP?
i) for loop ii) while loop iii) do-while loop iv) foreach loop
Correct : C. All of the above
15. If $a = 12 what will be returned when ($a == 12)? 5: 1 is executed?
Correct : D. 5
16. Who is the father of PHP?
Correct : A. Rasmus Lerdorf
17. What will be the output of the following php code?
<?php $num = "1"; $num1 = "2"; print $num+$num1; ?>
Correct : A. 3
18. Which of following variables can be assigned a value to it?
i) $3hello ii) $_hello iii) $this iv) $This
Correct : D. ii) and iv)
19. What will be the output of the following PHP code?
<?php $a = "clue"; $a .= "get"; echo "$a"; ?>