Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to start a PHP block.
PHP
<html> <body> <?php echo "Hello World!"; [1] </body> </html>
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
Using HTML tags like which don't exist
✗ Incorrect
PHP code blocks start with . The blank is for closing the PHP block.
2fill in blank
mediumComplete the code to embed PHP inside HTML to print a variable.
PHP
<html> <body> <?php $name = "Alice"; echo [1]; ?> </body> </html>
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using + to concatenate strings in PHP
Not using quotes around strings
✗ Incorrect
To print a string and a variable together, use concatenation with the dot operator.
3fill in blank
hardFix the error in the PHP tag to correctly embed PHP in HTML.
PHP
<html> <body> [1] echo "Welcome!"; ?> </body> </html>
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using short tags which may be disabled
Using HTML tags like