php mcq questions with answers


                                
What will be the value of $b after running the following code? $a = array('c', 'b', 'a'); $b = (array)$a;
A.TRUE
B.array('c', 'b', 'a')
C.array(array('c', 'b', 'a'))
D.None of the above
                                
Which of the following statements are correct? (Choose 2)
A.It is possible to specify more than one __autoload function
B.__autoload receives the missing class name all lowercased
C.__autoload is being called for missing interfaces
D.Inside __autoload missing classes trigger __autoload
                                
What piece of code would you use to obtain an array of response headers for a given URL, indexed by their respective names?
A.get_headers($url);
B.get_header($url);
C.stream_context_get_headers($url);
D.get_headers($url, 1);
E.get_headers($url, ASSOC_HEADERS);
                                
You analyze the code of a colleague and see a call to the function quotemeta()You give the string "Holy $%&[What's going on?" as a parameter to itWhat will it output?
A.Holy $%&[. What's going on?
B.Holy \$%&\[\. What's going on\?
C.Holy $%&[. What\'s going on?
D.Holy \$\%\&\[\. What\'s going on\?
                                
You want to extract the pieces of a date string, which looks like this: "2005-11-02"Which of the following pieces of code will properly assign $year, $month and $day with their respective values?
A.sscanf("2005-11-02", '%d-%d-%d', $year, $month, $day);
B.scan("2005-11-02", '%d-%d-%d', $year, $month, $day);
C.sscanf('%d-%d-%d', "2005-11-02", $year, $month, $day);
D.sscan($year, $month, $date '%d-%d-%d', "2005-11-02");