l() Link function adding Icon before Link Text Is there a way to pass in an icon inside the  tag of the link built by using the link (l()) function?  

&lt;a href="#"&gt;&lt;icon&gt; Link Text&lt;/a&gt;


I use it like so currently: 

l('text','path',options)


Options all seem to be attributes of the  tag itself besides the "text". Using html =>true, I can add  before the link text:

print l('&lt;span class="' . implode(" ",$link[options][attributes]["class"]) . '"&gt;&lt;/span&gt; ' . $link["link_title"]


However, I cannot check if the span isset inline there, unless I am missing something...

This works (below), but all my &lt;a&gt; have &lt;a&gt;&lt;span&gt;&lt;/span&gt; linktext... even if span is empty, and I don't want that blank tag in there:

&lt;li class="nav-item"&gt;&lt;?php print l('&lt;span class="' . implode(" ",$link[options][attributes]["class"]) . '"&gt;&lt;/span&gt; ' . $link["link_title"],$link["link_path"],array('attributes'=&gt; array('class'=&gt;array($link[options][item_attributes]["class"], 'nav-link')),'html' =&gt; TRUE)); ?&gt;&lt;/li&gt;


How can I add an icon, without CSS, before my link text as well as check if that span is empty?
you can use something like this:

l(t('Back'), 'node/' . implode(" ",$link[options][attributes]["class"]) . '/edit/', array('attributes' =&gt; array('class' =&gt; array('btn btn-default btn-back'))))