-2
<?php
$i = 0;
$array = array('name', 'email', 'address');
while ($array[$i]) {
echo "$array[$i]<br>";
$i++;
}
?>
PHP通知:未定義偏移量:3 /workspace/Main.php第6行爲什麼我會在下面的代碼中得到偏移錯誤?
的可能的複製[PHP:「注意:未定義變量」,「注意:未定義指數」和「通知:未定義偏移」](https://stackoverflow.com/問題/ 4261133/php-notice-undefined-variable-notice-undef-index-and-notice-undef) – BenRoob
適用於我... – Twinfriends
var_dump($ array [$ i])in while should should point you you the problem。 – BenRoob