php - What is the best method of maintaining a large query string? -


in several php applications i'm making need maintain long query string filters table. want change 1 or more variables per filter change, while rest of query string stays unchanged.

i have few ideas on how this, including using javascript build query string every time filter changed, or maintaining query string in session variable, changing there.

i opinions or experience on how best way be.

thanks!

yes, use associative array store map of keys values. can change 1 easily. these supported in both php , javascript, you're good.

you'll need write functions output array query string.

i did on lark once (and every time): alphabetize (or otherwise order) parameters in query string. why? convenient if same page has same url/query string. if write tests, it's easier assert query strings match. otherwise, @ mercy of associative array implementation's traversal order.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -