PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am making links like http://www.domain.tld/page.php?foo instead of the traditional ?foo=bar query string, but I don't want to give any particular action priority over another in case someone were to (strangely) enter more than one into the query string. I'd want it to, expectedly, take the first one and display according to it. The foreach is the only way that I know of to get an associative array in order.
Is there another way to do this (a function perhaps?), or should I just be content with this method?
It's true... There are array functions for everything.
I've just realized that if for some reason (one that's actually more possible) there is a get variable before one of the one's I am after, then I'd completely miss it. So, now I'm doing it this way:
miro_igov wrote:There are too much array functions and if you ask 100 coders to do specific array manipulation they all will provide different solutions
True. array_flip was all I was after. I couldn't remember the function name. ;_;
I'm not going to need array_unshift, though. in_array can take any value.