<?php
#I'm starting this program by assigning the value of -100 to the variable, $anyvariable.
$anyvariable = -100;
#The conditional if statement below checks to see if $anyvariable is at least 10.
if ($anyvariable >= 10) {
echo "The value, $anyvariable, is at least 10.";
}
#This "elseif" checks to see if $anyvariable having failed the first condition meets a second condition.
elseif ($anyvariable < 0) {
echo "The value, $anyvariable, is negative.";
}
else
{
echo "The value, $anyvariable, is a real number equal to or greater than 0 but less than 10.";
}
#The command below "prints" a line break onto the screen.
echo '<br />';
#The following command is a short-hand method of multiplying a variable by itself. It is equivalent to $anyvariable = $anyvariable * $anyvariable
$anyvariable *= $anyvariable;
#Print the result of the operation above and insert another line break.
echo "$anyvariable<br />";
#The following command sets up an array. Each value in the array is designated as $automakers[n] where n is some integer from 0 to 4. $automakers[0], for example, is Chevy.
$automakers = array('Chevy', 'Ford', 'Dodge', 'Toyota', 'Mercedes');
#The following two commands add Honda to the end of the array as $automakers[5] and displays the new array element.
$automakers[] = 'Honda';
echo $automakers[5];
echo '<br />';
#Below is an "associative array" in which the keys of the array are given names rather than numbers. The elements are then displayed.
$auto = array('maker' => 'General Motors',
'brand' => 'Pontiac',
'model' => 'LeMans',
'year' => '2006');
echo $auto['maker'];
echo '<br />';
echo $auto['brand'];
echo '<br />';
echo $auto['model'];
echo '<br />';
echo $auto['year'];
echo '<br />';
?>