I have a xml file which contains data I want to insert into a mysql database. Now I allready have entries in my database, so these should be updated, not existing should be added and - now comes the problem - the entries which are in the database but not in the xml should be deleted. So what I tried is creating 2 arrays, one containing some comparison values of the xml data, so for example
$array_new["some1"] = "test";
$array_new["some2] = "test2";
and the other one containing the old data like $array_old["some1"] = "something"; $array_old["some2"] = "test2";
Now I would like to compare these 2 arrays and add all the values which are NOT in both to a new array. I tried using array_diff but this will only add the one value which is not in both arrays to a new array. But I need to have all the values which have the same key in a new array so I can delete them.
Anyone has any idea how to accomplish this? Thanks!