Figured it out:
I used URL.js to get the query parameters using
URI(location.href).query(true)
I get an object with a few properties, including "view-mode" and "filters[one]=1&filters[two]=2" where "filters[one]=1&filters[two]=2" is an object (based on the way URL.js parses the query).
Then I iterate through the object and check if the property is an object. If it is, I use Ben Alman's BBQ jQuery Plugin to parse the property name which turns:
filters%5Bone%5D%3D1%26filters%5Btwo%5D%3D2
into:
{
"filters" : {
"one" : "1",
"two" : "2"
}
}
The URI.js parsing method also results in a few properties that have no value such as "*filters[one]=1&filters[two]=21*" and "*filters[one]=1&filters[two]=2[]*". I ignore those.
Then I can combine the original properties that aren't objects such as "view-mode=grid" with the parsed properties that are objects, such as "filters%5Bone%5D%3D1%26filters%5Btwo%5D%3D2" and I end up with:
{
"view-mode" : "grid",
"filters" : {
"one" : "1",
"two" : "2"
}
}
End result is that both Javascript and PHP can read and understand the query parameters.