43.8k views
5 votes
What will be displayed in a browser when the following PHP code

is executed:
<?php
if ("Philip" == "philip") {
echo "Hello World
";
}
echo "Done!
";
?>

User Stames
by
9.0k points

1 Answer

3 votes

Final answer:

The browser will display 'Done!' since the PHP string comparison is case-sensitive and the condition in the if statement is false.

Step-by-step explanation:

When the PHP code is executed, the browser will display Done! PHP string comparison is case-sensitive, so "Philip" is not equal to "philip". Since the condition in the if statement evaluates to false, the echo statement inside the if block will not be executed. Only the echo statement outside of the if block, which prints Done!, will be executed.

User George Phillipson
by
8.3k points