PHP Introduction
- What will be the output of the following PHP code?
<?php
$str = "Interview";
$str .= "Mania";
echo "$str";
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
.= is a concatenation-assignment. $str equals its current value concatenated with “get”.
- What will be the output of the following PHP code?
<?php
$num = 6;
$num1 = 6;
echo ($num === $num1);
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
=== operator returns 1 if $num and $num1 are equivalent and $num and $num1 have the same type.
- Which of the below symbols is a newline character?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
PHP treats \n as newline character.
- What will be the output of the following PHP code?
$n = 18;
echo 'What is her age? \n She is $n years old.';
?>
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
When a string is enclosed within single quotes both variables and escape sequences will not be interpreted when the string is parsed.
- Which of the conditional statements is/are supported by PHP?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
switch statements, if-elseif statements, if statements and if-else statements of the conditional statements are supported by PHP.