php mcq questions with answers


                                
Given the default PHP configuration, how can all of the parameters provided via GET be accessed in a form of a string?
A.$_GET['ALL']
B.$_SERVER['QUERY']
C.$_SERVER['QUERY_STRING']
D.$_ENV['QUERY']
E.$QUERY_STRING
                                
What is the output of the following code? <?php function append($str) { $str = $str.'append'; } function prepend(&$str) { $str = 'prepend'.$str; } $string = 'zce'; append(prepend($string)); echo $string; ?>
A.zceappend
B.prependzceappend
C.prependzce
D.zce
                                
You are creating an application that generates invoices in a variety of formats, including PDF, ODS and HTMLEach of these formats is represented as a PHP class in your applicationWhile some of the operations can be performed on all of the different formats (such as saving and loading), other operations may be specific to one or two of the formats (such as setting as read only)Which design pattern should you use for this application?
A.Adapter
B.Factory
C.MVC
D.Singleton
                                
You want to parse a URL into its single partsWhich function do you choose?
A.parse_url()
B.url_parse()
C.get_url_parts()
D.geturlparts()
                                
What function returns the filename component of the file's path:
A.dirname() realpath()
B.basename()
C.pathinfo()
D.parse_url()