A
Q. What will be the output of the following PHP code ?
Code:<?php
print("this"."was"."a"."bad"."idea");
?>
Here, you will find a collection of MCQ questions on PHP. Go through these questions to enhance your preparation for upcoming examinations and interviews.
To check the correct answer, simply click the View Answer button provided for each question.
Have your own questions to contribute? Click the button below to share your MCQs with others!
+ Add QuestionA
<?php
print("this"."was"."a"."bad"."idea");
?>
A
<?php
define("GREETING", "PHP is a scripting language");
echo $GREETING;
?>
A
<?php
define("__LINE__", "PHP is a scripting language");
echo __LINE__;
?>
A
<?php
define("NEW_GOOD_NAME_CONSTANT", "I have a value");
define("OLD_BAD_NAME_CONSTANT", NEW_GOOD_NAME_CONSTANT);
echo NEW_GOOD_NAME_CONSTANT;
echo OLD_BAD_NAME_CONSTANT;
?>
A
<?php
define("VAR_NAME","test");
${VAR_NAME} = "value";
echo VAR_NAME;
echo ${VAR_NAME};
?>
A
A
A
A
A
<?php
$x = 10;
$y = 20;
if ($x > $y && 1||1)
print "1000 PHP MCQ" ;
else
print "Welcome to McqBuddy";
?>
If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.
Share Your MCQ