ERREUR Undefined offset dans une boucle
Bonjour,
J'ai une erreur concernant un index indéfini dans une boucle et je ne vois quelle peut être la solution.
Code:
1 2 3 4 5 6 7 8 9 10 11
| while ($sommaire[$n][0]!=null) {
if($sommaire[$n][1]=="sommaire0") {
$index0=$index0."<TD style=\"background-color: #55AAFF ;\" WIDTH=".intval($largeur/$a)."><a style=\" text-decoration: none; \" href=\"#\" onclick=\"ShowPage('".$sommaire[$n][0]."')\">".$sommaire0[0].$sommaire[$n][0].$sommaire0[1]."</a></TD>";
//echo $index0;
} else {
//$sommaire[$n-1][1]<$sommaire[$n][1];
$indexcol[$sommaire[$n][2]]=$indexcol[$sommaire[$n][2]]."<a style=\"text-decoration: none; \" href=\"#\" onclick=\"ShowPage('".$sommaire[$n][0]."')\">".$sommaire1[0].$sommaire[$n][0].$sommaire1[1]."</a>";
}
$n++;
} |
Citation:
Notice: Undefined offset: 2 in C:\serveur\apache2\htdocs\eeeter\sommaire.php on line 56
Cette ligne correspond à
Code:
$indexcol[$sommaire[$n][2]]=$indexcol[$sommaire[$n][2]]."<a style=\"text-decoration: none; \" href=\"#\" onclick=\"ShowPage('".$sommaire[$n][0]."')\">".$sommaire1[0].$sommaire[$n][0].$sommaire1[1]."</a>";