What is the difference between using curly braces and not using curly braces in a foreach loop in PHP?

When using a foreach loop in PHP, if you are only executing a single statement inside the loop, you can choose to omit the curly braces. However, if you need to execute multiple statements within the loop, you should use curly braces to encapsulate the block of code. This helps improve code readability and maintainability. Example:

// Using curly braces for multiple statements inside the foreach loop
foreach ($array as $item) {
    echo $item;
    echo "<br>";
}

// Not using curly braces for a single statement inside the foreach loop
foreach ($array as $item)
    echo $item;