PHP Syntax
- What will be the output of the following PHP code ?
<?php
$country = "India";
echo "$country";
echo "$COUNTRY";
echo "$Country";
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
In PHP, all variables are case-sensitive.
- What will be the output of the following PHP code ?
<?php
# echo "Hello interview Mania";
echo "# Hello interview Mania";
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
# is a single line comment.
- What will be the output of the following PHP code ?
<?php
echo "Hello Interview Mania"
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
You can use tags like italics, bold etc. inside php script.
- What will be the output of the following PHP code ?
<?php
echo "echo "Hello Interview Mania"";
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
It would have printed echo “Hello world” if the statement was echo “echo \”Hello Interview Mania\””;.
- What will be the output of the following PHP code ?
<?php
<?php
echo "Hello Interview Mania";
?>
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
You can not have php tags inside a php tag.