PHP Echo/Print
- What will be the output of the following PHP code ?
<?php
$First = "Mania";
$Second = "Interview";
echo "$First"+"$Second";
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
In an echo statement you can not use plus sign to join two strings.
- What will be the output of the following PHP code ?
<?php
$First = "Hello ";
$Second = "Interview Mania";
echo $First, $Second;
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Echo can print two variables which are separated by a comma.
- What will be the output of the following PHP code ?
<?php
$First = "Interview ";
$Second = "Mania";
echo "$First$Second";
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Even though both the variables are inside the double-quotes, the value of the variable is substituted and then printed to the screen.
- What will be the output of the following PHP code ?
<?php
echo "it","is"|"a","good"."name";
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
You can use only comma and dot operator to join starings, other characters do not have the same function.
- What will be the output of the following PHP code ?
<?php
echo "This is <i>Interview Mania</i>";
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
This is Interview Mania