What's wrong with this?  More or less straight jacked this from drupal_parse_url() documentation.  Using it the same way with drupal_goto as it is used with url() in the example.  https://api.drupal.org/api/drupal/includes!common.inc/function/drupal_parse_url/7