PHP

PHP, Learn Something New

One

<?php $user = "you"; ?>
Hello <?php echo $user; ?>!

<?php echo "Goodbye, you!"; ?>

<?php 
$x = 2; $y = 5;
$total = $x + $y;
echo $total;
?>

<?php 
$counter = [0,1,2,3];
print_r($counter);
echo "\n";
echo count($counter);
$first_count = $counter[3];
echo "\nCounting backwards from $first_count\n ";
$counter[3] = 33;
$first_count = $counter[3];
    echo "Eh, is the counting backwards from $first_count correct?\n ";
unset($counter[3]); // removes the 33
$first_count = $counter[2];
echo "Hmm, now it's counting from $first_count\n ";
?>

output . . .

Hello you!

Goodbye, you!
7
Array
(
    [0] => 0
    [1] => 1
    [2] => 2
    [3] => 3
)
Array
(
    [0] => 0
    [1] => 1
    [2] => 2
    [3] => 3
)
1
4
Counting backwards from 3
 Eh, is the counting backwards from 33 correct?
 Hmm, now it's counting from 2