Complete the code to print 'Hello World' in PHP.
<?php [1] "Hello World"; ?>
The echo statement outputs text in PHP. It is the simplest way to display 'Hello World'.
Complete the code to correctly start a PHP script.
[1]
// This is a PHP script
?>The correct way to start a PHP script is with <?php. This tells the server to process the code as PHP.
Fix the error in the code to correctly print 'Hello World'.
<?php echo [1]Hello World[2]; ?>
Strings in PHP can be enclosed in double quotes " or single quotes '. Here, double quotes are used correctly to surround the string.
Fill both blanks to create a PHP script that prints 'Hello World' and ends correctly.
[1] echo "Hello World";[2]
The PHP script starts with <?php and ends with ?>. The semicolon ends the echo statement.
Fill all three blanks to create a PHP script that prints 'Hello World' with correct syntax.
[1] echo [2]Hello World[3];
The script starts with <?php. The string is enclosed in double quotes " on both sides. The semicolon ends the statement.