php Undefined Offset in einfacher Funktion()

Ich bin mir nicht sicher, warum ich bin immer ein Undefined Offset Beachten Sie:

<?php 

$numbers = array('1','2','3');
$total = 0;

for($i=0;$i<=sizeof($numbers); $i++) {
    $total += $numbers[$i];
    echo $total;
}

?>

Ausgabe:

136
Notice: Undefined offset: 3 in E:\php\arrays\array_1.php auf Zeile 17
6

InformationsquelleAutor OldWest | 2011-07-14

Schreibe einen Kommentar