Create link with 'name' attribute only using l() function
Sadly this cannot be accomplish with the l function because the href is hard-coded in the theme_link theme function.

You can accomplish this by using the html_tag theme function.

It'll look something like this

return theme('html_tag', array('element' =&gt; array('#tag' =&gt; 'a', '#value' =&gt; 'A link here', '#attributes' =&gt; array('name' =&gt; 'my-anchor'))));


This will return 

&lt;a name="my-anchor"&gt;A link here&lt;/a&gt;


Is a bit more work, but it does give you a properly formatted a tag with out the href.