[eluser]Armchair Samurai[/eluser]
When CI parses the anchor function it automatically includes the
title attribute by default, which is the same as the text. So when you try something like this:
Code:
<?=anchor('path/here', '<img src="/path/to/image" alt="" />');?>
CI uses <img src="/path/to/image" alt="" /> as the title, which causes the issues. The output would be:
Code:
<a href="path/here" title="<img src="/path/to/image" alt="" />"><img src="/path/to/image" alt="" /></a>
As you can see, not only it the title non-sensical, with all the double quotes in there it's a mess. Hence, adding the third parameter overrides the default inclusion of the title attribute. Reversing the quotes will make things work without the third parameter, but you still end up with a crap title attribute:
Code:
// input
<?=anchor('path/here', "<img src='/path/to/image' alt='' />");?>
<!-- output -->
<a href="path/here" title="<img src='/path/to/image' alt='' />"><img src='/path/to/image' alt='' /></a>
IMHO it's easier to just use HTML and use site_url() if you're worried about CI URIs.