Virajsinh

PhP_Quiz_01

Feb 8th, 2018
64
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 1) Which of the following is called configuration file or initialization file of PHP
  2. - php.ini
  3.  
  4. 2) Which of the following is true statement ?
  5. - Apache is used as a web server of php
  6.  
  7. 3) Which of the following is used to print something in PHP ?
  8. - print_r, print, echo
  9.  
  10. 4) Which of the following is used for concatenation in PHP ?
  11. - .(dot)
  12.  
  13. 5) Which of the following is super global variable of PHP ?
  14. - $_GET
  15.  
  16. 6) Which of the following super global variable stores information such as headers, file paths, scripts, etc.
  17. - $_SERVER
  18.  
  19. 7) Consider following code and specify the output of the same
  20. $x = 10;
  21.  
  22. echo gettype($x);
  23. - It will print integer is a type of variable
  24.  
  25. 8) What will be the output for following code
  26.  
  27. <?php
  28.  
  29. $x = 10;
  30.  
  31. if($x=="10")
  32.  
  33. echo "Hello";
  34.  
  35. else
  36.  
  37. echo "Hi";
  38.  
  39. ?>
  40. - This will print Hello
  41.  
  42. 9) What will be the output of following code ?
  43.  
  44. <?php
  45.  
  46. for($x=1; $x<=10; $x++)
  47.  
  48. {
  49.  
  50. if($x%2==0)
  51.  
  52. continue;
  53.  
  54. else
  55.  
  56. echo $x;
  57.  
  58. }
  59.  
  60. ?>
  61. - It will print 1 3 5 7 9
  62.  
  63. 10) Consider following code and identify the output
  64.  
  65. <?php
  66.  
  67. function hello()
  68.  
  69. {
  70.  
  71. echo "Arguments : ".func_num_args();
  72.  
  73. }
  74.  
  75. hello(10, 22, "Hello", 90);
  76.  
  77. ?>
  78. - Arguments : 4
RAW Paste Data