I function and menu_link I need to put an id in menu links  i have this code from here https://api.drupal.org/api/drupal/includes!menu.inc/function/theme_menu_link/7.

function theme_menu_link(array $variables) {
  $element = $variables['element'];
  $sub_menu = '';

  if ($element['#below']) {
    $sub_menu = drupal_render($element['#below']);
  }
  $output = l($element['#title'], $element['#href'], $element['#localized_options']);
  return '&lt;li' . drupal_attributes($element['#attributes']) . '&gt;' . $output . $sub_menu . "&lt;/li&gt;\n";
} 


And have found the code i need but am struggling where to place it in the function. This code https://api.drupal.org/comment/45408#comment-45408: 

l( t('Refresh Page'), $path . '/getdata', array(
              'attributes' =&gt; array(
                'id' =&gt; '', 
                'class' =&gt; 'btn-small btn-primary '
              ),'query' =&gt; drupal_get_destination() , 'html' =&gt; TRUE)),

    );


Where would it go, i know what i need, but i am having difficulty doing it. 

Thanks
You can use this module to place different menu attributes to your menu links:
Menu Attributes 

This simple module allows you to specify some additional attributes for menu items such as id, name, class, style, and rel.
You should use this module when

You want to &quot;nofollow&quot; certain menu items to sculpt the flow of PageRank through your site.

You want to give a menu item an ID so you can easily select it using jQuery.

You want to add additional classes or styles to a menu item.



You can also add the ID using theme_menu_link like you were using above, you would place that code in your template.php of your theme.
If you use the Devel module you can print out the $variables array and see the different parts of the array there. You would basically want to use the mlid and the attributes part of the link to build out the ID (see code snippet below).
$element['#attributes']['id'] = 'menu-' . $element['#original_link']['mlid'];

If you need any other information just let me know, thanks!