php mcq questions with answers


                                
Would the following code catch a parse error? try { echo $label } catch (Exception $e) { echo $e->getMessage(); }
A.Yes
B.No
                                
What function is ideal for outputting contents of a static file to screen?
A.file_get_contents()
B.readfile()
C.fread()
D.include()
E.require()
F.file()
                                
Which parts of the text are matched in the following regular expression? <?php $text = <<<EOT The big bang bonged under the bung. EOT; preg_match_all('@b.n?g@', $text, $matches); ?>
A.bang bong bung
B.bang bonged bung
C.big bang bong bung
D.big bang bung
                                
What is the result of the following bitwise operation in PHP? 1 ^ 2
A.1
B.3
C.2
D.4
                                
How many array elements will be found in the return value of: split(".", "A.B.C")
A.B.C") A. 2
B.C") A. 2 B. 3
C.1
D.6
E.4