I have a chunk of HTML code (with some PHP vars echoed inside of it) that I need show on multiple times (inside a loop) AND on multiple pages.
So how to keep it DRY?
My ideas admittedly were not brilliant:
Putting it in a separate file and including - but then I'll do an include inside a loop and it showed like bad practice.
Putting it in a function - but then I have to make variables global plus it just doesn't look to me like functions are meant for such usage.
Is there a better way? Is this where maybe OOP has a solution? (I run php 5.3)