Order of name value pairs changes between PHP and AS3

I am loading MySQL SELECT query results back into AS. The php loads all rows from a database, parses it into a string of name value pairs with the row number added to the name, and then echos it. The AS loads that string, and then I will break it back up into rows using the row number and put them into separate arrays. (I figured this method would be fastest and require the least code)

For some reason the order of the name value pairs is changing between PHP and AS


/*
PHP string if I simply navigate to the page:

survey1name=test1&survey1author=Andrew+Long&survey1link=exampleURL1.com&survey1orderIndex=1&survey2name=test2&survey2author=Andrew+Long2&survey2link=exampleURL2.com&survey2orderIndex=1&survey3name=test3&survey3author=Andrew+Long3&survey3link=exampleURL3.com&survey3orderIndex=2

AS String (this one seems to be out of order): 

survey2link=exampleURL2.com&survey3name=test3&survey3author=Andrew%20Long3&survey1author=Andrew%20Long&survey1link=exampleURL1.com&survey3orderIndex=2&survey2author=Andrew%20Long2&survey2orderIndex=1&survey1name=test1&survey1orderIndex=1&survey3link=exampleURL3.com

AS string is trace of event.target.data, so this should be its most raw state.
*/

The changed order seems to be persistent in that if I test it multiple times it is always the same. But once I changed the PHP, then uploaded it, and changed it back to the way it was before, uploaded it again, and the order changed and remained persistent.

I’m sure I can find a way to make it work, but it would a lot easier to just take the first 4 properties in a URLVariables object, then the next 4 and so on instead of finding all properties that contain the number 1, then all properties that contain the number 2 (also this has made me quite curious as to how the whole process works).

Bonus question 1: In a tutorial, it told me to, in the PHP script, use urlEncode() on the values since they will include special characters and spaces and such. In initial testing, it seems AS converts everything behind the scenes for me and I do not need to urlEncode() them first. If I leave the encoding out of the PHP script, will I have trouble down the line? Second, I can’t seem to find a method in AS to un-url-encode a string. Is there one?

Bonus question 2: I am a little confused as to what it is that actionscript “loads” when using URLLoader. The documentation is vague: “downloads all of the data from a URL… as text, binary data, or URL-encoded variables.” But what’s the data? From tutorials I learned that for php it loads whatever you tell php to print to the screen. Is that how it works with all loaded URLs. If I tell it to load kirupa.com, will it return a bunch of HTML code?