Forum Moderators: coopster
I'm successfully able to compare two different arrays with array_diff(). The result of this comparison is, of course, assigned to a new array.
Unfortunatly (for my purposes) the array indeces of the resulting matching items are retained, yet empty:
[a][b][empty][d][empty][empty][g] - and so on.
I'm wondering if there's a built-in function that would sequentially assign all non-empty index items of my array_diff() result to a second array, like:
[a][b][d][g]
I know I can do this with a loop, but am wondering if there's already a function to handle this.
Neophyte
Do you need to keep the indexes of the resulting array, or only the values matters?
If is the last case you can use array_values [php.net]