×

php · level 1 · unit 2 · lesson 3

  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

Give every box a name that tells you what is inside.

After the $, a name starts with a letter or an underscore, _. Then use letters, digits and underscores. No spaces, and no digit straight after the $, so $2nd_place will not work.

Variable names are , so $Pet and $pet are two different boxes. Pick one way to write each name and stick to it.

Good names say what is inside, like $best_friend rather than $x. Small letters with underscores between the words is called , because the name lies long and low, like a snake.

<?php
$best_friend = "Priya";
$favourite_food = "pasta";
echo $best_friend . " loves " . $favourite_food . "\n";

Long, clear names cost nothing, and they save you guessing later what $x meant.