I would like to merge two arrays containing a list of files plus their revision in brackets.
For example:
First array:
['A[1]', 'B[2]', 'C[2]', 'D[2]']
Second one:
['B[3]', 'C[4]', 'E[4]', 'F[2]', 'G[2]']
Like I said, I would be able to merge both arrays, but overwriting the first one by the data present in the second one where the letter/filenames collide.
I used this regex to only grab filenames (removing the revision number). I don't know if I am correct on this point:
/\[[^\)]+\]/
The result I am looking for would be this,
['A[1]', 'B[3]', 'C[4]', 'D[2]', 'E[4]', 'F[2]', 'G[2]']
I'm using PHP4 at the moment.