Is it possible to select an array to use in a foreach statement can't figure it out :/
My Code:
<?php
$selmon = $_GET['m'];
$selectmon = ('$' . $months[$selmon-1]);
foreach ($selectmon as $day){
if ($day % 7 == 0){
echo ("<td>" . $day . "</td>");
echo ("</tr>");
echo ("<tr>");
}else{
echo ("<td>" . $day . "</td>");
}}
?>
My arrays basically contain a list of all the days in the month e.g.?
$september = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30);
Am I going about this the wrong way or is it even possible?
Also I have an array of the month names:
$months = array("january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december");
and if i use
echo $selectmon;
If i use localhost/index.php?m=1 it returns
$january