I'm dealing with a scrupt that for some reason can't read normal $_GET and $_POST and just reads the whole thing as a string. This is the string it reads and I'm given this as output.
?field1=value1&field2=value2&field3=value3
I'm writing a function that works with this output to break it up into its individual field1, field2, field3 values. The issue is that not all fields may be present and there's a possibility someone may add fields that shouldn't exist. For example I may get
?field1=value1&field3=value3 (no field2)
?field1=value1&field4=value4 (I don't even have field4)
Can this be done with a regex? or is there a better way?