sort() expects parameter 1 to be array, null given
Posted: Thu Jun 19, 2003 12:38 am
sort() expects parameter 1 to be array, null given
Variable passed to each() is not an array or object
I can't figure out what it is talking about since both have an array in them!
Variable passed to each() is not an array or object
I can't figure out what it is talking about since both have an array in them!
Code: Select all
Function getEvent ($theyear, $themonth, $theday)
{
$data_file = "../data/cd.dat";
if(file_exists($data_file))
{
$data_lines = file($data_file);
}
$Now = date(Ymd);
sort($data_lines); //it's angry here
$ts = mktime(0,0,0,substr($ts,4,2),substr($ts,6,2),substr($ts,0,4));
while (list($Index, $Data) = each($data_lines)) //And angry here as well
{
list($Date, $Type, $Title, $Time, $Location, $Price, $Description) = explode("|", $Data);
if (($Date) && (substr($ts,0,4) == $theyear) && (substr($ts,4,2) == $themonth) && (substr($ts,6,2) == $theday))
{
if ($Title != "")
{
return "<br>$Title";
}
}
}