I'm loading an XML file, which happens to have duplicate items in it. I wish to remove those, but trying so throws me an error:
Message: It is not yet possible to assign complex types to properties
The return of the xml function is off course an object, where the items are stored in an array. Those items are object again, so I guess this makes it a bit harder to check against duplicates.
I've tried fixing this with:
array_unique((array) $XMLObject);
But that doesn't seem to work.
Anyone got an idea?
Here's my xml-object:
object(SimpleXMLElement)#19 (5) {
["title"]=>
string(33) "P2000 alarmeringen Heel Nederland"
["link"]=>
string(26) "http://www.p2000zhz-rr.nl/"
["description"]=>
string(54) "Hier vind u alle P2000 alarmeringen van Heel Nederland"
["lastBuildDate"]=>
string(31) "Mon, 10 Sep 2012 22:19:28 +0000"
["item"]=>
array(300) {
[0]=>
object(SimpleXMLElement)#22 (5) {
["title"]=>
string(4) "test"
["link"]=>
string(82) "http://feedproxy.google.com/~r/p2000-nederland/~3/OeCbBLSpOKQ/p2000-nederland.html"
["description"]=>
string(194) "Melding: test Korps/Voertuig: AMBU Brabant Noord (Den Bosch-Ambu 21-102) Capcode: 1121020<img src="http://feeds.feedburner.com/~r/p2000-nederland/~4/OeCbBLSpOKQ" height="1" width="1"/>"
["pubDate"]=>
string(31) "Mon, 10 Sep 2012 22:20:08 +0000"
["guid"]=>
string(25) "10-09-12_22:20.08_1121020"
}
[1]=>
object(SimpleXMLElement)#23 (5) {
["title"]=>
string(18) "contact supervisor"
["link"]=>
string(82) "http://feedproxy.google.com/~r/p2000-nederland/~3/OeCbBLSpOKQ/p2000-nederland.html"
["description"]=>
string(197) "Melding: contact supervisor Korps/Voertuig: regio 15 Haaglanden POLITIE 10 Capcode: 1530710<img src="http://feeds.feedburner.com/~r/p2000-nederland/~4/OeCbBLSpOKQ" height="1" width="1"/>"
["pubDate"]=>
string(31) "Mon, 10 Sep 2012 22:19:28 +0000"
["guid"]=>
string(25) "10-09-12_22:19.28_1530710"
}
So it needs to fix unique strings at: $Object->item[1]->title