adplus-dvertising

Welcome to the Basics of PHP MCQs Page

Dive deep into the fascinating world of Basics of PHP with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Basics of PHP, a crucial aspect of PHP. In this section, you will encounter a diverse range of MCQs that cover various aspects of Basics of PHP, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within PHP.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Basics of PHP. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of PHP.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Basics of PHP. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Basics of PHP MCQs | Page 9 of 11

Explore more Topics under PHP

Q81.
Which of the following must be installed on your computer so as to run PHP script?

i) Adobe Dreamweaver
ii) PHP
iii) Apache
iv) IIS
Discuss
Answer: (d).ii), iii) and iv)
Q82.
Which version of PHP introduced Try/catch Exception?
Discuss
Answer: (b).PHP 5
Q83.
We can use ___ to comment a single line?
i) /?
ii) //
iii) #
iv) /* */
Discuss
Answer: (c).ii), iii) and iv)
Q84.
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;
Discuss
Answer: (c).Only iii)
Q85.
What will be the output of the following php code?
    <?php
    $num  = 1;
    $num1 = 2;
    print $num . "+". $num1;
    ?>
Discuss
Answer: (b).1+2
Q86.
What will be the output of the following php code?
 <?php
    $num  = "1";
    $num1 = "2";
    print $num+$num1;
    ?>
Discuss
Answer: (a).3
Q87.
Which of following variables can be assigned a value to it?

i) $3hello
ii) $_hello
iii) $this
iv) $This
Discuss
Answer: (d).ii) and iv)
Q88.
What will be the output of the following code?
<?php 
    $foo = 'Bob';              
    $bar = &$foo;              
    $bar = "My name is $bar";  
    echo $bar;
    echo $foo;
    ?>
Discuss
Answer: (c).My name is BobMy name is Bob
Q89.
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”);
Discuss
Answer: (b).i), ii) and iii)
Q90.
What will be the output of the following PHP code?
<?php
    $color = "maroon";
    $var = $color[2];
    echo "$var";
    ?>
Discuss
Answer: (d).r

Suggested Topics

Are you eager to expand your knowledge beyond PHP? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!