I've been reading a book on Zend framework and there's this HTML/PHP code section I can't figure out. It's contained in the VIEWS part of the MVC methodology:
<select name="genre">
<?php foreach ($this->genres as $genre) { ?>
<option value="<?php echo $genre ?>"><?php echo $genre ?></option>
<?php } ?>
</select>
The genre ($this->genres) refers to array('rock', 'r&b', 'country', 'rap', 'gospel', 'rock n roll', 'techno').
The code runs perfectly, producing a drop-down select menu, but I don't understand how the second line is even legal, let alone work. How does the PHP code work beyond its enclosing tags?