×

php · level 1 · unit 2 · 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

Put something new in a box and the old thing is gone.

A variable holds one value at a time. Put a new value in and you the old one. The old value is gone for good.

You can copy one box into another. $snack = $treat; puts a copy of what is in $treat into $snack. Change $treat later and $snack keeps its copy.

A dot, ., will strings into one longer string: "Hot" . "dog" gives "Hotdog". The dot adds no spaces, so put any spaces you need inside the quotes.

<?php
$mood = "sleepy";
$mood = "happy";
echo "I feel " . $mood . "\n";

Spaces around the . make your code easier to read, but they never appear in the output.