I've attempted using a for loop and heredoc in php using similar code:
$options = '';
for($Year = date("Y"); $Year <= date("Y") + 5; $Year++)
{ $options .= "<option>$Year</option>\n"; }
$Select = <<<QQxQQ
<select>
$options
</select>
QQxQQ;
print "$Select";
But no luck...
EDIT These examples are great, thanks guys. This is what I'm trying to iterate
<li><a href="#"><span>$looped</span></a></li>
Where $looped is a value of a fetched mysql column. As you can probably see, I'm trying to iterate an element of a list x amount of times (where x = number of rows of sql query).
I thought trying to put the results into an array and then cycling through the array, however I still couldn't get the HTML code to go through the parser accordingly without being considered a string.