\n"; //data type
echo $list_price." is a ";
echo gettype($list_price)."
\n"; //data type
echo $first_name."
\n";
echo $last_name."
\n";
echo $is_valid."
\n"; //true is 1
echo $is_new."
\n"; //false shows nothing
?>
\n";
$result = $x - $y;
echo $x." - ".$y." = ".$result. "
\n";
$result = $x * $y;
echo $x." x ".$y." = ".$result. "
\n";
$result = $x / $y;
$result = number_format($result, 2); //round, 2 decimal places
echo $x." / ".$y." = ".$result. "
\n";
?>
\n");
$date = date('m/d/y');
echo ($date."
\n");
$date = date('d/m/Y'); //british
echo ($date."
\n");
$date = date('M.d.Y');
echo ($date."
\n");
$date = date('m/d/y---h:i:A');
echo ($date."
\n");
?>
\n";
} else {
echo "$first is NOT equal to $second
\n";
}
if (empty($investment)) //variable not declared
{
$message = "Investment is a required field.";
echo $message."
\n";
}
$investment = ""; //declared but empty
if (empty($investment)) //not declared
{
$message = "Investment is a required field.";
echo $message."
\n";
}
?>
\n";
$counter++;
}
echo "
\n";
$num = 200;
do {
echo "$num
\n";
$num = $num+1;
}while ($num <= 206);
echo "
\n";
for ($counter=1; $counter<=12; $counter=$counter+2)
{
echo "$counter
\n";
}
echo "
\n";
for ($x=1; $x<=6; $x++)
{
for ($y=1; $y<=12; $y++)
{
echo $x.",".$y."; ";
}
echo "
\n";
}
echo "
\n";
?>
| 1 | 2 | 3 |
| 1 | 2 | 3 |