Explore topic-wise MCQs in Technical MCQs.

This section includes 9 Mcqs, each offering curated multiple-choice questions to sharpen your Technical MCQs knowledge and support exam preparation. Choose a topic below to get started.

1.

<?phpfunction sample()	{	&dollar;var1=20;	echo &dollar;var1;	echo &dollar;GLOBALS['var1'];	}&dollar;var1=10;sample();echo &dollar;var1;?>
20.what $_SERVER variable do?

A. Will give the information about all the predefined variables to know the server information
B. To get the information about the files uploaded using POST methods
C. When the information is passed using POST methods
D. None of the above
E.
Answer» B. To get the information about the files uploaded using POST methods
2.

<?php&dollar;i=10;function sample(&dollar;i){    &dollar;i+=2;    GLOBAL &dollar;i;    echo &dollar;i+&dollar;i,",";}echo &dollar;i.",";GLOBAL &dollar;i;sample(&dollar;i);echo &dollar;i;?>
19.Predict the output of the following code snippet :

A. 201010
B. 202010
C. 101010
D. 201020
Answer» B. 202010
3.

<?php&dollar;i=10;function sample(&dollar;i){          &dollar;i++;          echo &dollar;i.",";}echo &dollar;i.",";GLOBAL &dollar;i;sample(&dollar;i);echo &dollar;i;?>
18.Predict the output of the following code snippet :

A. 10,20,10
B. 10,24,10
C. 10,20,20
D. 10,22,10
Answer» B. 10,24,10
4.

<?phpfunction myTest() {    static &dollar;x;    echo &dollar;x;}myTest();?> 
16.Which of the following is NOT a superglobal variable ?

A. &dollar;_SERVER
B. &dollar;_GLOBAL
C. &dollar;_GET
D. &dollar;_POST
Answer» C. &dollar;_GET
5.

Which of the following will be output of the following code?

A. 0
B. 1
C. No Output
D. Error
Answer» D. Error
6.

A variable declared _____ has a LOCAL SCOPE?

A. outside program
B. inside function
C. outside function
D. None Of the Above
Answer» C. outside function
7.

A variable declared _____ has a GLOBAL SCOPE?

A. outside program
B. inside function
C. outside function
D. None Of the Above
Answer» D. None Of the Above
8.

choose the incorrect variable name in php?

A. $_AGE
B. $18AGE
C. $AGE18
D. $_AGE18
Answer» C. $AGE18
9.

Variables are ________ for storing information.

A. decimal
B. storage
C. numbers
D. containers
Answer» E.