What is the correct syntax for a foreach loop in PHP?

When using a foreach loop in PHP, the correct syntax involves specifying the array or iterable object to loop through, followed by the keyword 'as' and a variable to represent each element of the array in each iteration. This variable will hold the current value of the array element being processed. It is important to ensure that the array or iterable object is properly defined and that the variable used in the loop is unique and meaningful.

// Example of correct syntax for a foreach loop in PHP
$colors = array("red", "green", "blue");

foreach ($colors as $color) {
    echo $color . "<br>";
}