I am trying to end a URL router created for my user MVC environment. I have a list of parameters that I have broken down from the url, but the problem is that they only have numeric keys. I want to configure it so that the first value in the $ params array is KEY, and then the second value in the array is VALUE of the first KEY. But I need to take it even more. Essentially, I need all the odd number values ββin the array to be the new KEY value, and the even number value to be the value.
Example:
Here's how it is STRONGLY configured:
Array ( [0] => greeting [1] => hello [2] => question [3] => how-are-you [4] => response [5] => im-fine )
Here's how it is needed (after conversion):
Array ( [greeting] => hello [question] => how-are-you [response] => im-fine )
Would it be easier to create this type of array when I blow up the string using the delimiter '/', when I pull it out of the URL string? If so, what would be the best feature to do this?
This is probably a simple solution because I'm sure this is a common problem, but any enlightenment?
source share