Functions - Study Mode
[#1] Which of the following PHP functions can be used to get the current memory usage?
Correct Answer
(C) get_memory_usage()
Explanation
Solution: We can use the memory_get_usage() function, and to get the highest amount of memory used at any point, we can use the memory_get_peak_usage() function.
[#2] Which of the following PHP functions can be used for generating unique id’s?
Correct Answer
(A) uniqueid()
Explanation
Solution: 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.
[#3] Which one of the following functions can be used to compress a string?
Correct Answer
(D) gzcompress()
Explanation
Solution: We will be able to achieve almost 50% size reduction using this function. The gzuncompress() function is used to uncompress the string.
[#4] . . . . . converts the keys of an array into values and the values into keys.
Correct Answer
(D) array_flip()
[#5] phpinfo() will display about? 1. OS version information 2. PHP installation 3. Variables 4. HTTP headers
Correct Answer
Option 1