我剛剛學習 laravel 并得到了這個錯誤

使用 foreach 在路由類上呼叫陣列,但出現錯誤(未定義索引)

uj5u.com熱心網友回復:
您在 foreach 范圍內使用了錯誤的變數。
使用$post["title"]代替$posts["title"]
// @foreach ($posts as $post)
$posts: entire array
$post: an item of array
uj5u.com熱心網友回復:
您應該使用拼寫錯誤
$post["title"] not $posts["title"]
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/361742.html
下一篇:如何組合具有相同值的陣列
