SCook Posted January 30, 2008 Share Posted January 30, 2008 Hi all, Is there a way to move a post variable to another index in the post array? For example: $_POST["one"], $_POST["two"], $_POST["three"] to make it:v $_POST["three"], $_POST["one"], $_POST["two"] Link to comment https://forums.phpfreaks.com/topic/88574-re-ordering-post-variables/ Share on other sites More sharing options...
SCook Posted January 30, 2008 Author Share Posted January 30, 2008 No one has anything huh? :-) Link to comment https://forums.phpfreaks.com/topic/88574-re-ordering-post-variables/#findComment-453657 Share on other sites More sharing options...
trq Posted January 30, 2008 Share Posted January 30, 2008 Associative arrays are not in any order so no, not really. Why would you need to do this? Link to comment https://forums.phpfreaks.com/topic/88574-re-ordering-post-variables/#findComment-453678 Share on other sites More sharing options...
SCook Posted January 30, 2008 Author Share Posted January 30, 2008 Well, if they aren't in any order, then why do they show up wirth print_r in the order they were created from a form? The reason is that I'm creating dynamic mysql entries using the post array submitted from a form. What I'm doing is coming a month, day, year field into one date variable. So what I do is unser the month, day, and year variables and create a $_POST["date"] variable. Now, when I do this, query creation, the date variable is at the end of the array, not in the space it should be. There fore, I need to move it forward. Link to comment https://forums.phpfreaks.com/topic/88574-re-ordering-post-variables/#findComment-453701 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.