I have two questions.
1) How do you reindex an array?
Say my array has gaps in it like this:
array
[1] name1
[2]
[3] name2
[4]
[5]
I want to reindex it like this
[1] name1
[2] name2
2nd question is much more complicated. I am trying to match names.
I have two associate arrays which is a scoreboard. One of them is from a database.
Like this
name score
Fred 5
Barney 10
I am reading the other array from a database.
name score
Wilma 2
Barney 4
If the names match, I want to add their scores and put that in the database. If the names don't match then I want to just put their name and score in the database.
So Barney will have a 14, Fred will still have a 5 and is a new guy, and Wilma will remain unchanged.
I know how to get them to the database and from the database, what I am having trouble with is the actual array functions.