<HTML>
<HEAD>
<TITLE>
</TITLE>
</HEAD>
<BODY>

<?php

// More about one-dimensional arrays 
// Initializing arrays and using
// Using count
// Using foreach
// Accessing the indices

$day1 = array('Sat', 'Sun', 'Mon', 'Tues', 'Wed', 'Thurs', 'Fri');
$day2 = array(1 => 'Sat', 'Sun', 'Mon', 'Tues', 'Wed', 'Thurs', 'Fri');
$day3 = array('S' => 'Sat', 'Su' => 'Sun', 'M' => 'Mon', 'T' => 
	'Tues', 'W' => 'Wed', 'R' => 'Thurs', 'F' => 'Fri');
$day4 = array(1 => 'Sat', 'Sun', 'Mon', 'Tues', 'Wed', 'Thurs', 'Fri', 
	'S' => 'Sat', 'Su' => 'Sun', 'M' => 'Mon', 'T' =>
	'Tues', 'W' => 'Wed', 'R' => 'Thurs', 'F' => 'Fri');

// $day3 = array('S' => 'Sat', 'Sun', 'Mon'); // Index of Sun will be 0.


echo "Array day1 contains ", count($day1), "<BR>";
echo "Array day1 contains count($day1) <BR>"; // No, prints count(Array)
echo "Array day4 contains ", count($day4), "<P>";

echo "WE're here now<P>";

foreach ($day1 as $r)
	echo "$r ";
echo "<BR>";
foreach ($day2 as $val)
        echo "$val ";
echo "<BR>";
foreach ($day3 as $val)
        echo "$val ";
foreach ($day4 as $val)
        echo "$val ";

echo "<BR>";

echo "==========<BR>";
echo "<BR>day1 = ", $day1, "<BR>"; // Prints day1 = Array
echo "==========<BR>";
foreach ($day1 as $i => $v) 
        echo "day1[$i] = $v, ";

echo "<BR>";
foreach ($day2 as $k => $value)
        echo "day2[$k] = $value, ";
echo "<BR>";

echo "Print day3<BR>";
foreach ($day3 as $k => $value)
        echo "day3[$k] = $value, ";

echo "<BR>";
foreach ($day4 as $k => $value)
        echo "day4[$k] = $value, ";

echo "<P>";

for ($i=0; $i < count($day1) ; $i++)
	echo "day1[$i] = $day1[$i], ";

?>

</BODY>
</HTML>
