我有这个片段:
$tableau = array_intersect(GetSearchByRegion($_SESSION['region']),
GetSearchByCity($_SESSION['city']),
GetSearchByState($_SESSION['state']),
GetSearchByCountry($_SESSION['country']),
GetSearchByKeywords($_SESSION['keywords']),
GetSearchByDate($_SESSION['date']),
GetSearchByCompany($_SESSION['company']),
GetSearchByCategory($_SESSION['category']));
if(sizeof($tableau) == 0)
{
header('Location: fail.html');
}
else
{
$tableau1 = array_intersect(GetSearchByRegion($_SESSION['region']),
GetSearchByState($_SESSION['state']));
echo "size of state =".sizeof(GetSearchByState($_SESSION['state']))."</br>";
echo "size total".sizeof($tableau)."</br>";
echo sizeof($tableau1)."</br>";
// $_SESSION['liste'] =GetInformationsFromId($tableau);
// header('Location: list.php');
}
问题是结果是size of state =1
size total3
3
我不知道为什么交集不起作用:一个大小为 1 的表在另一个表之间结果通常是一个大小为 au max 等于一个的表。所以:
- 我需要知道错误是什么
- 我该如何解决?