I have a CGI query like this: 'a=1&b=2&c=3'.
I want to extract it in an associative array A such as $A[a]=1, $A[b]=2 and $[c]=3.
I found this way, but I would like to find a simpler (shorter) way to this :
QUERY='a=1&b=2&c=3'
typeset -a T
T=( ${(s:&:)QUERY} )
typeset -A A
A=()
for v in $T; do
A+=( ${(s:=:)v} )
done
(bonus: find a way to handle URL encoded values)