hello... quick problem that's got me stuck.
I've got some .php function files that i'm including in my form page.
One - sys_info.php defines the arrays that I use all over the site.
ex:
$semesters = array("08" => "Fall",
"01" => "Spring", "06" => "Summer");
In another function page - format_functions.php, I want to use this $semesters array.
ex:
function format_dateToSemester($dateArray)
{
//! look up the month > semester
foreach($semesters as $month => $sem)
{
if($month == $dateArray["month"])
$dateString = $sem;
}
//!going for "Spring 2004" format
$dateString .= " ".$dateArray["year"];
return $dateString;
}
So, if I'm calling format_dateToSemester($X) on a page that has
require_once('sys_info.php');
include_once('format_functions.php');
at the top, what is going wrong? I don't want to pass the array into the function, and when I put the global keyword before $semesters, everything breaks.
Thanks in advance.
-n