0
0
PHPprogramming~10 mins

Echo statement in PHP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to print the word Hello.

PHP
<?php
[1] "Hello";
?>
Drag options to blanks, or click blank then click option'
Awrite
Becho
Cshow
Dprint
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'write' or 'show' which are not PHP commands.
Forgetting to add a semicolon at the end.
2fill in blank
medium

Complete the code to print the number 123.

PHP
<?php
[1] 123;
?>
Drag options to blanks, or click blank then click option'
Aprint
Bwrite
Cecho
Dshow
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'write' or 'show' which are not valid PHP commands.
Trying to use parentheses like a function.
3fill in blank
hard

Fix the error in the code to correctly print Hello World.

PHP
<?php
[1] "Hello World";
?>
Drag options to blanks, or click blank then click option'
Aecho
Bprint
Cecho;
Decho()
Attempts:
3 left
💡 Hint
Common Mistakes
Adding parentheses after echo which is not a function.
Forgetting the semicolon at the end.
4fill in blank
hard

Fill both blanks to print the phrase Hello PHP.

PHP
<?php
[1] [2];
?>
Drag options to blanks, or click blank then click option'
Aecho
B"Hello PHP"
C'Hello PHP'
Dprint
Attempts:
3 left
💡 Hint
Common Mistakes
Using print with double quotes but forgetting the semicolon.
Using single quotes when double quotes are expected.
5fill in blank
hard

Fill both blanks to print the sentence Hello, PHP learner!

PHP
<?php
[1] [2] ;
?>
Drag options to blanks, or click blank then click option'
Aecho
B"Hello, PHP learner!"
C;
Dprint
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the semicolon at the end.
Using print without semicolon.