PHP array/function problem
I'm having a problem trying to understand why a predefined array is not being echoed/print_r when requested from inside a function.
the array is global(?) by being defined outside the function(s). I can't seem to see why it wont show the array?
It works outside the function
$mondayset=array("setone", "settwo", "setthree", "setfour");
$tuesdayset=array(""setfive", "setsix", setseven");
function dosets ($pubdate)
{
$caledardate = explode("/", $pubdate);
$timestamp = strtotime("$caledardate[2]"."-"."$caledardate[0]"."-"."$caledardate[1]");
if(date('D', $timestamp) === 'Mon')
{
echo "It is Monday today\n";
print_r($mondayset);
}
$thedate = 12/2/2013
dosets($thedate)
