Character escaping rules for $form_state['redirect'] I'm writing a redirect for the form submit function, the redirect part looks like this 

$form_state['redirect'] = array(
// $path
'catalog/search',
// $options
array('query' =&gt; array("circle_op=&lt;&amp;a%5Bvalue%5D=28&amp;a%5Bl%5D" =&gt; $location, 'p' =&gt; $keyword,)),
// $http_response_code
    302,
  );


The problem is that the "circle_op=&lt;&amp;a%5Bvalue%5D=28&amp;a%5Bl%5D" part on redirect transforms into "%253Ccircle_op%3D&lt;%26a%255Bvalue%255D%3D28%26a%255Bl%255D%3D" inside URL.

Please explain, how to pass this key value correctly?

Thanks
The rule for query strings is pretty simple; you need a key, and a value. The format for this key/value pair is:

key=value


Both the key and the value will be URL encoded, so any special characters are escaped. 

Take the = sign for example. Your sample code above uses:

circle_op=&lt;&amp;a%5Bvalue%5D=28&amp;a%5Bl%50 

as a key, and a value from the variable $location as a value. So without being escaped, your query string looks like this:

?circle_op=&lt;&amp;a%5Bvalue%5D=28&amp;a%5Bl%5D=VALUE_OF_LOCATION_VAR


Obviously if a browser was to encounter that URL it wouldn't know what to do; there are two equal signs, so it doesn't know what is supposed to be the key, and what is supposed to be the value. It can make a guess but that's not the point.

The URL that you are redirecting to is absolutely the correct one for the input you've given for your redirect URL.