What common syntax errors can occur when trying to display images from a folder using PHP?

Common syntax errors when trying to display images from a folder using PHP include incorrect file paths, missing quotation marks, and forgetting to concatenate variables correctly. To solve this issue, ensure that the file paths are correct, use quotation marks around file paths, and properly concatenate variables within the file paths.

<?php
$folder = "images/";
$files = glob($folder . "*.{jpg,png,gif}", GLOB_BRACE);

foreach($files as $file) {
    echo '<img src="' . $file . '" alt="Image">';
}
?>