php mcq questions with answers


                                
How many elements does the array $pieces contain after the following piece of code has been executed? $pieces = explode("/", "///");
A.0
B.3
C.4
D.5
                                
Which of the following statements about database connections are commonly true? (Choose 2)
A.Database connections are closed after each SQL statement is executed
B.Database connections are closed at the end of each request
C.Database connections are only closed when the Web server shuts down
D.A single database connection may serve more than one PHP application at the same time
                                
Which of the following function signatures is correct if you want to have classes automatically loaded?
A.function autoload($class_name)
B.function __autoload($class_name, $file)
C.function __autoload($class_name)
D.function _autoload($class_name)
E.function autoload($class_name, $file)
                                
What SimpleXML function is used to parse a file?
A.simplexml_load_file()
B.simplexml_load_string()
C.load()
D.loadFile()
E.loadXML()
F.None of the above.
                                
One common security risk is exposing error messages directly in the browserWhich PHP configuration directive can be disabled to prevent this?
A.html_display
B.error_reporting
C.display_errors
D.error_log
E.ignore_repeated_errors