Answer:- (A). Explanations :When you pass an argument in the above manner or say we pass 15 and 3 directly, it is called passing by value or call by value.
Q15. Which of the following function is capable of reading a specifice number of characters form a file ?
fgets()
fget()
fileget()
filegets()
Answer:- (D).
Q16. When you use the $_GET variable to collect data, the data is visible to ?
none
only you
everyone
selected few
Answer:- (3).
Q17. Which variable is used to collect form data sent with both the GET and POST methods ?
$BOTH
$_BOTH
$REQUEST
$_REQUEST
Answer:- (4).
Q18. To validate an e-mail address, which flag is to be passed to the function filter_var() ?
FILTER_VALIDATE_EMAIL
FILTER_VALIDATE_MAIL
VALIDATE_EMAIL
VALIDATE_MAIL
Answer:- (1).
Q19. What will be the output of the following PHP code ?
Answer:- (2). Explanations : As we are flippling the values, $fruits["mango"] = 0, $fruits["apple"] = 1 and so on.
Q20. Which of the following is not a variable scope in PHP ?
Extern
Local
Static
Global
Answer:- (1). Explanations :The scope of a variable is defined as its range in the program under which it can be accessed.
Q21. Which of the following is the use of strpos() function in PHP ?
The strpos() function is used to search for the spaces in a string
The strpos() function is used to search for a number in a string
The strpos() fucntion is used to search for a character/text in a string
The strpos() function is used to search for a capitalize character in a string
Answer:- (3). Explanations :The strpos() is in-built function of PHP. It is used to find the position of the first occurence of a string inside another string
or substring in a string.
Q22. What is the use of fopen() function in PHP ?
The fopen() function is used to open folders in PHP
The fopen() function is used to open remote server
The fopen() function is used to open files in PHP
None of the above
Answer:- (3). Explanations : The fopen() function accepts two arguments: $filename and $mode. The $filename represents the file to e opened and $mode represents the file mode.
Q23. What will be the output of the following program ?
Answer:- (1). Explanations : In the given program, first the show() function is called, and the variable $a is initialized to 20, and 20 is printed on the screen.
Later, the global variable $a is initialized to 15, and the value 15 is printed on the screen. So the output of the above program will be 2015.
Q24. What will be the output of the following program ?