1. Which function sets the file filename’s last-modified and last-accessed times?
Explanation: Its prototype is int touch(string filename [, int time [, int atime]]). It returns TRUE on success or FALSE on error.
2. Which one is not a data type in PHP?
Explanation: The void is not a data type in PHP.
3. [:alpha:] can also be specified as.
Explanation: [:alpha:] is nothing but Lowercase and uppercase alphabetical characters.
4. Which one of the following function reads a directory into an Array?
Explanation: It returns an array consisting of files and directories found in directory or returns FALSE on error.
5. How many functions does PHP offer for searching strings using POSIX style regular expression?
Explanation: ereg(), ereg_replace(), eregi(), eregi_replace(), split(), spliti(), and sql_regcase() are the functions offered.
6. A function in PHP which starts with __ (double underscore) is known as.
a) Magic Function
b) Inbuilt Function
c) Default Function
d) User Defined Function
Explanation: PHP functions that start with a double underscore – a “__” – are called magic functions in PHP. They are functions that are always defined inside classes, and are not stand-alone functions.
7. Which loop evaluates the condition expression as Boolean, if it is true, it executes the statements and when it is false it will terminate?
a) For loop
b) while loop
c) do-while loop
d) All of the above
Explanation: While loop evaluates the condition expression as Boolean, if it is true, it executes the statements and when it is false it will terminate.
8. Which of the following PHP functions can be used for generating unique id’s?
Explanation: Many people use the md5() function for this, even though it’s not exactly meant for this purpose. uniqueid() is the function that is to be used.
9. Which one of the following preg PHP functions is used to take a string, and put it in an array?
Explanation: The string is broken up into different values in the array based upon your input.
10. Which one of the following functions can be used to compress a string?
Explanation: We will be able to achieve almost 50% size reduction using this function. The gzuncompress() function is used to uncompress the string.