52: How do you read from standard input in PHP?
Answer:
One should use fopen() to open PHP://stdin to read from standard input in PHP.
53: How to obtain a lock on a file in PHP?
Answer:
Flock() function in PHP provides file locking.
54: Suppose you want to obscure all but last four digits of the credit card number, how will you do that?
Answer:
One can use PHP substr_replace() function to achieve this.
68: What does uksort() function do in PHP?
Answer:
This function sorts an array of keys using a user-defined comparison function.
69: How can you access global variables inside a function?
Answer:
One can bring the global variable into local scope with the global keyword or use it directly in $GLOBALS.
70: Does PHP support functions with variable number of arguments?
Answer:
Yes, this is doable in PHP, either by using an array or even without using arrays as arguments.
71: Should we use <? ?> tag mode or <?PHP ?> one?
Answer:
We should <?PHP ?> as the older one is getting deprecated now. Latest Zend engine recommends the later one to be used. We can enable this strict option in PHP.ini file as short_open_tag = off.
93: Does fclose() function return anything?
Answer:
It is not a void function. It returns a bool, indicating whether shutdown of the file has been successful or not.
103: Does PHP support data encapsulation?
Answer:
PHP supports data encapsulation by providing access specifiers such as public, private, protected to the class members.
104: Does PHP support exception handling?
Answer:
Yes, PHP supports exception handling using the usual try/catch block.
151: What configuration line in PHP.ini enables/disables file upload in PHP?
Answer:
This line enables the file upload in PHP - File_uploads = ON. We need to enable this in PHP.ini
152: What is log4PHP?
Answer:
Log4PHP is the logging framework for PHP by Apache software foundation.
194: Can you have multiple active session objects at a time in PHP?
Answer:
No, it is not possible in PHP to have multiple active session objects at one time.
195: What should be done to handle multiple page form when we need to preserve from one page to the next?
Answer:
One needs to use session tracking to achieve this. Session tracking is secure because user cannot modify session variables.



