PHP Variables
-  What will be the output of the following PHP code ?<?php 
 $p = 6;
 $q = 5;
 function Res($p = 5, $q = 6)
 {
 $r = $p+$q/$q+$p;
 echo "$r";
 }
 echo $p;
 echo $q;
 echo $r;
 Res($p, $q);
 ?>
- 
                        View Hint View Answer Discuss in Forum NA Correct Option: EFirstly, the statements outside the function are printed, since r is not defined it’ll no value is printed for r. Next the function is called and the value of r inside the function is printed. 
-  What will be the output of the following PHP code ?<?php 
 $n = 25;
 function Res()
 {
 $n = 15;
 echo "$n";
 }
 Res();
 echo "$n";
 ?>
- 
                        View Hint View Answer Discuss in Forum NA Correct Option: CFirst when the function is called variable n is initialised to 15 so 15 is printed later the global value 25 is printed. 
-  What will be the output of the following PHP code ?<?php 
 $p = 51;
 function Result()
 {
 echo "$p";
 }
 Result();
 ?>
- 
                        View Hint View Answer Discuss in Forum NA Correct Option: CThe variable p is not defined inside the function Result(), therefore nothing is printed on the screen. 
-  What will be the output of the following PHP code ?<?php 
 $n = 25;
 {
 echo "$n";
 }
 ?>
- 
                        View Hint View Answer Discuss in Forum NA Correct Option: BThe variable n stores the value 25 and therefore the value 25 is printed on the screen. 
-  What will be the output of the following PHP code ?<?php 
 $n = 10;
 {
 $n = 20;
 echo "$n";
 }
 echo "$n";
 ?>
- 
                        View Hint View Answer Discuss in Forum NA Correct Option: DVariable n stores the value 20 and not 10. 
 
	