Getting URL query parameters array where unwanted elements are removed. For that you can use drupal_get_query_parameters function. In default q parameter will be removed. That parameter includes current clean path.
Source code viewer
// Assignable attributes are: array $query = NULL, array $exclude = array('q'), $parent = ''. drupal_get_query_parameters();Programming Language: PHP