RSS DAILY NEWS TICKER EXAMPLE


home > overview

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.




click here to see original article or to find similar articles

 RSS DAILY HEADLINES

HEADLINES

Candidates assess Fannie-Freddie rescue

Sept. 6: Both Sen. Barack Obama and Sen. John McCain talked about their views on the current loan crisis while on the campaign trail. NBC's Brian Mooar reports. (NBC News Channel)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.


One Last Look at the Republican Convention: the Balloon Drop!

I was listening to McCain's nomination acceptance speech on the radio on the way to the airport yesterday and it sounded so different than it did in the arena. I actually got to hear the fiery end to the speech, the part where he said:

Stand up, stand up, stand up and fight. Nothing is inevitable here. We're Americans, and we never give up. We never quit. We never hide from history. We make history.

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.

To see the balloon drop,

read more

Lebanese hold reconciliation talks in volatile city (Reuters) Reuters - Lebanese Sunni Muslim leader Saad al-Hariri held talks with an Alawite community leader in a volatile northern city overnight, paving the way for agreement to end four months of sectarian tensions, politicians said on Sunday.


Find this article in Google