0
抵消我有簡單的代碼樓下:PHP未定義,在陣列循環
$i = 0;
$array = array('name','email','address');
while ($array[$i]) {
echo "$array[$i]<br>";
$i++;
}
我的問題:呼應的姓名,電子郵件,地址沒有問題後,它會產生一個錯誤消息「未定義抵消:3」。 我堅持要用WHILE循環代替IF條件。如何處理錯誤。 謝謝
[PHP: 「通知:未定義的變量」, 「通知:未定義指數」 和 「通知:未定義抵消」]的可能的複製(http://stackoverflow.com/questions/4261133/ php-notice-undefined-variable-notice-undefined-index-and-notice-undef) –
use:'while(isset($ array [$ i])){'解決你的問題。你應該在詢問之前進行搜索和嘗試。 –
謝謝Suchit kumar我的兄弟,你解決了我的問題 –