Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\shirts.php on line 30 - I cant see My Problem


$products = array();
$products[101] = "Logo Shirt, Red";
$products[102] = "Mike the Frog Shirt, Black";
$products[103] = "Mike the Frog Shirt, Blue";
$products[104] = "Logo Shirt, Green";


$pageTitle = "Full Catalog Page";
$section = "shirts";


    <div class="section page">

        <h1>Mike&rsquo;s Full Catalog Page</h1>

            <?php foreach($products as $product); { ?>
            <li><?php echo $product; ?></li>
            <li>Mike the Frog Shirt, Black</li>
            <li>Mike the Frog Shirt, Blue</li>

<?php include('inc/footer.php'); ?>

3 Answers

Dai Phong
Dai Phong
20,395 Points

I see you don't close the foreach loop, and you place a wrong ";" after foreach loop.

Andrew Dushane
Andrew Dushane
9,264 Points

You're missing a closing curly brace for your foreach loop.

<li><?php echo $product; ?></li>
<?php } ?>

I'm assuming you'll want to take out the two static li items as well.

Thank you!! I have been staring at this like crazy.

Sometimes you just need a new set of eye to catch it!!