×

php · level 1 · unit 1 · lesson 2

  1. meet it
  2. guess first
  3. your turn
  4. fix it
  5. nailed it

Tap a green word if you get lost.

meet it

shows a message on the screen.

Every PHP program starts with <?php on its first line. This tells the computer that PHP code starts here. Without it, your code is shown as plain text instead of running.

echo shows something on the screen. Words go inside double quote marks, like "Hello, world!". A piece of text in quotes is called a . Picture the letters threaded on a string, like beads.

End each instruction with a semicolon, ;, like a full stop. The \n near the end means : it moves the screen on, ready for whatever comes next.

<?php
echo "Hello, world!\n";

The quotes and the \n are instructions for PHP, so they are not shown on the screen.