Lesson 4 of 3013%

(Progress persistence is disabled until Phase 9)

PHP
Beginner

Echo and Print

Learn about Echo and Print in PHP.

PHP is a powerful server-side language. In this lesson, we will cover Echo and Print.

Real code examples

<?php
// echo can take multiple parameters (though rare)
echo "This ", "string ", "was ", "made ", "with multiple parameters.\n";

// print returns 1, so it can be used in expressions
$result = print("Hello World!\n");
?>

Common mistakes

Make sure you include the <?php tag when writing PHP!

Try It Yourself

You can experiment with this in the Playground.

Lesson Progress

Take QuizBuild a PHP Project