SyntaxFix
Write A Post
Hire A Developer
Questions
If the indexes are continuous:
foreach ($arr as $key => $val) { if (isset($arr[$key+1])) { echo $arr[$key+1]; // next element } else { // end of array reached } }