Return doesn't put variable where it belongs (6 posts)

I have created a function that returns a string of HTML. Problem is, I am using bloginfo("template_url") to get the path to an images folder inside my theme. The result of bloginfo() gets output outside the HTML created by the function. Why is this, and how do I fix it?