How to parse current page URL query parameters to create link using l() function
Maybe something like this would be sufficient?

$url = drupal_parse_url('example.com/node?location=XXX&amp;check-in=XXX&amp;check-out=XXX&amp;lang=XXX.');
$desired_params = array_intersect_key($url['query'], array_flip(array('check-in', 'check-out')));


array_intersect_key() will return the values in the first array whose keys also exist in the second array, while array_flip() inverts the values in the array with their keys, actually generating something like the following (in my example):

array(
  'check-in' =&gt; 0,
  'check-out' =&gt; 1,
)


You can probably use the same approach or a very similar one with view::get_exposed_input, which is probably the best way of getting the data you need.



I didn't get that you also needed to rename the parameters. Then I don't think there's any advantage in filtering the parameters, just pull out the ones you need by hand.

$params = drupal_parse_url('...');
l("link_name","http://www.example.com/path",
  array('attributes' =&gt; array('target' =&gt; 'blank'),
  'query'=&gt;array(
    'lang' =&gt; 'en',
    'currency' =&gt; 'USD',
    'standardCheckin' =&gt; $params['query']['check-in'],
    'standardCheckout'=&gt;$params['query']['check-out']
   )
  )
);