PHP Build a Basic PHP Website Listing and Sorting Inventory Items Displaying All Items

17,750 Points

Why does teacher concatentate src and alt attributes?

This works perfect fine, is clearn, and easier read. Am I missing something?

foreach($catalog as $item => $id) {
     echo "<li><a href='#'><img src='$id[img]' alt='$id[title]'>View Details</a></li>";
Michel Ribbens
Michel Ribbens
18,417 Points

so true

her code is very, very messy (in my opinion) and there is absolutely no reason to use all the . and "" this will just lead to unnecessary errors