Choose a topic to test your knowledge and improve your PHP skills
What does PHP stand for? i) Personal Home Page ii) Hypertext Preprocessor iii) Pretext Hypertext Processor iv) Preprocessor Home Page
PHP files have a default file extension of_______
What should be the correct syntax to write a PHP code?
Which of the following is/are a PHP code editor?
Which of the following must be installed on your computer so as to run PHP script? i) Adobe Dreamweaver ii) XAMPP iii) Apache and PHP iv) IIS
Which version of PHP introduced Try/catch Exception?
How should we add a single line comment in our PHP code? i) /? ii) // iii) # iv) /* */
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; ?>
Which is the right way of declaring a variable in PHP? i) $3hello ii) $_hello iii) $this iv) $This
What will be the output of the following PHP 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"; ?>
Which of the below statements is equivalent to $add += $add?
Which statement will output $x on the screen?
Which statement will output $x on the screen?
What will be the output of the following PHP code? <?php function track() { static $count = 0; $count++; echo $count; } track(); track(); track(); ?>
What will be the output of the following PHP code? <?php $a = "clue"; $a .= "get"; echo "$a"; ?>
What will be the output of the following PHP code? <?php $a = 5; $b = 5; echo ($a === $b); ?>
Which of the below symbols is a newline character?
Which of the conditional statements is/are supported by PHP? i) if statements ii) if-else statements iii) if-elseif statements iv) switch statements
What will be the output of the following PHP code? <?php $team = "arsenal"; switch ($team) { case "manu": echo "I love man u"; case "arsenal": echo "I love arsenal"; case "manc": echo "I love manc"; } ?>
What will be the output of the following PHP code? <?php $user = array("Ashley", "Bale", "Shrek", "Blank"); for ($x=0; $x < count($user); $x++) { if ($user[$x] == "Shrek") continue; printf ($user[$x]); } ?>
If $a = 12 what will be returned when ($a == 12) ? 5 : 1 is executed?
What will be the value of $a and $b after the function call in the following PHP code? <?php function doSomething( &$arg ) { $return = $arg; $arg += 1; return $return; } $a = 3; $b = doSomething( $a ); ?>
Who is the father of PHP?