Move array values arround

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!

Moderator: General Moderators

Post Reply
doeboy
Forum Newbie
Posts: 10
Joined: Sun Mar 21, 2004 10:18 am

Move array values arround

Post by doeboy »

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.
doeboy
Forum Newbie
Posts: 10
Joined: Sun Mar 21, 2004 10:18 am

Post by doeboy »

Never mind, I figured it out.
Post Reply