CSE MCQs :: PHP MCQs
-
Which of the following php statement/statements will store 111 in variable num?i) int $num = 111;ii) int mum = 111;iii) $num = 111;iv) 111 = $num;
-
What will be the output of the following php code
< ?php $num = 1; $num1 = 2; print $num . "+". $num1 ; ?>
-
What will be the output of the following php code?
< ?php $num = "1"; $num1 = "2"; print $num+$num1 ; ?>
-
Which of following variables can be assigned a value to it?(i) $3hello(ii) $_hello(iii) $this(iv) $This
-
What will be the output of the following code?
< ?php $foo = 'Bob'; $bar = &$foo; $bar = "My name is $bar"; echo $bar; echo $foo; ?>
-
Which of the following PHP statements will output Hello World on the screen?(i) echo ("Hello World);(ii) print ("Hello World);(iii) printf ("Hello World);(iv) sprintf ("Hello World);
-
What will be the output of the following PHP code?
< ?php $color = "maroon"; $var = $color[2]; echo "$var" ; ?>
-
What will be the output of the following PHP code?
< ?php $score = 1234; $scoreboard = (array) $score; echo $scoreboard[0]; ?>
-
What will be the output of the following PHP code?
< ?php $total = "25 students"; $more = 10; $total = $total + $more; echo "$total" ; ?>