Brian Moon's Blog: Stupid PHP Tricks: Normalizing SimpleXML Data
Brian Moon has a "stupid PHP trick" posted to his blog today - normalizing SimpleXML data you've pulled in from just about any external source.
Anyhow, one annoying thing about SimpleXML has to do with caching. When using web services, we often cache the contents we get back. We were having a problem where we would get an error about a SimpleXML node not existing.
They were using memcache to store the information but came across problems when their code tried to use a (sometimes) empty tag. He gives two solutions - one using a recursive function that identifies the empty items and the other that encodes then decodes the object to and from JSON, keeping the values intact.
The historic takeover of Fannie Mae and Freddie Mac, which could come as soon as this weekend, moved to the forefront of the presidential campaign Saturday.
In the arena that night, the whole last minute was drowned out by cheers — and then when the soaring music swelled, the confetti rained down as the harbinger of balloons and the hopeful first family took the stage, forget about it — it was a perfect end to a convention that last Monday, no one even knew if it would happen. But it did, and I'm so glad to have been there.