I came across a post over at Jake Munson’s blog which had just what I needed. Actually although Jakes solution was perfectly valid, I preferred a slight modification from one of the commenters which wrapped the entire URL string into an associative array so you can access the entire URL scope, as well as extracting a specific value via a key. Thanks Chad (and Jake).
So if you had a URL like http://www.mysite.com/?s=the first param&email;=firstname.lastname@example.org you could get the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
To access the “email” key in the URL, simply call
Another modification which I added was to unescape any strings, so removing things like %20 (a space character) that might be in the URL value. The following will automatically unescape all values, if this isn’t what you want you can pass “false” to the function (i.e. Learnosity.getURL(false);)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19