Hi everyone, I'm having some trouble with the array_sort function - one value always gets returns false, when it shouldn't. At least I think thats the problem - I must admit, I'm getting more than a little confused here.
My array is something like this:
$mntharr[0] = 12
$mntharr[1] = 11
$mntharr[2] = 10
$mntharr[3] = 9
$mntharr[4] = 8
and my code is this:
for ($i=1; $i < 13; ++$i) {
if((array_search($i, $mntharr)) != false) {
echo("<td><a href=\"showtour.php?y=".($y)."&m=".$i."\">".date("F",mktime(0,0,0,$i,1,2000))."</a></td>");
} else {
echo("<td>".date("F",mktime(0,0,0,$i,1,2000))."</td>");
}
}
Initially, I thought this was working fine - but then I realised that the first value in the array ($mntharr[0]) never returns true in the array_sort function. In this case, 12 - so the hyperlink doesnt get output.
What am I doing wrong here?