Move array values arround
Posted: Sun Mar 21, 2004 10:18 am
I have an array that is being created from a database:
array("0=>Val","1=>Val","2=>Val",..."999999=>New Val");
I have a script that will move items up and down, one slot at a time by clicking on a link.
My question though is that if I have an array as above, and I just added a new value to the database (999999), how can I get it to move to a user chosen location. I.e. I want the new value (999999) to be at 4, and then shift all of the rest of the remaining values down 1?
Thank you for your help.
array("0=>Val","1=>Val","2=>Val",..."999999=>New Val");
I have a script that will move items up and down, one slot at a time by clicking on a link.
My question though is that if I have an array as above, and I just added a new value to the database (999999), how can I get it to move to a user chosen location. I.e. I want the new value (999999) to be at 4, and then shift all of the rest of the remaining values down 1?
Thank you for your help.