Example
Close a foreach loop block:
html
<?php
$cars = ["Ford", "Volvo", "BMW"];
foreach($cars as $car):
echo "$car <br>";
endforeach;
?>
Definition and Usage
The endforeach keyword is used to close the code block of a foreach loop which was started using the foreach(...): syntax.
Related Pages
The foreach keyword.