Q: Which one of the following function is capable of reading a specific number of characters form a file?
A.fgets()
B. fget()
C. fileget()
D. filegets()
Correct Option: AExplanation: Its prototype is string fgets(resource handle [, int length]). If the optional length parameter is omitted, 1024 character is assumed.
Q: Which of the following are valid function names?
i) function()
ii) €()
iii) .function()
iv) $function()
A.Only (ii)
B.None of the mentioned.
C.All of the mentioned.
D.(iii) and (iv)
Correct Option: AExplanation: Except a) others are invalid names. According to the specified regular expression ([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*), a function name like this one is valid.
Q: Which one of the following function outputs the contents of a string variable to the specified resource?
A.filewrite()
B. fwrite()
C. filewrites()
D.fwrites()
Correct Option: BExplanation: fwrite()
Q: Which one of the following PHP functions can be used to find files?
A.glob()
B.file()
C.fold()
D.get_file()
Correct Option: AExplanation: glob()
Q: What will be the output of the following PHP code?
Correct Option: CExplanation: You can designate certain arguments as optional by placing them at the end of the list and assigning them a default value of nothing.
Q: Which one of the following PHP function is used to determine a file
A.fileltime()
B. filectime()
C.fileatime()
D.filetime()
Correct Option: CExplanation: The fileatime() function returns a file’s last access time in Unix timestamp format or FALSE on error.
Q: Which one of the following function reads a directory into an Array?
A.scandir()
B.readdir()
C.scandirectory()
D.readdirectory()
Correct Option: AExplanation: It returns an array consisting of files and directories found in directory or returns FALSE on error.
Q: What will be the output of the following PHP code?
Q: What will be the output of the following PHP code?
< ?php
echo ord ("hi");
?>
A.106
B.103
C.104
D. 209
Correct Option: CExplanation: The ord() function returns the ASCII value of the first character of a string. The ASCII value of h is 104, thus 104 was displayed.
Q: What will be the output of the following PHP code?
< ?php
echo ucwords("i love my country");
?>
A. I love my country
B. i love my Country
C.I love my Country
D.I Love My Country
Correct Option: DExplanation: The ucwords() function converts the first character of each word in a string to uppercase.