开发者

Should I use Curl or XML Parsing

I am about to write a script that links multiple databases across servers in php, and I am trying to decide the best tack to take. I like my DOMDocuments, and already have multiple xml feeds coming from the database that the others can hook into. On the other hand the database it fed by a form, and this could easily send its data across t开发者_运维技巧he other datbases on submit using Curl or even jsonp.

My personal feeling is parse the xml on a daily basis, but the other approach would make the db linkup more instantanious.

What do you guys think?


I think its better you use something like JSON with less oerhead. With XML you have a lot of overhead.

Or you use a socket and send the data direct over connection with your own short protocol. I think XML is ok but for linking server is JSON or a Socket really better.


I think we would definitely need some more information here before we can give you solid advice.

But I definitely lean toward the form route, of the two options you've outlined, for sure.

On the one hand, you said the xml feeds already exist. If they contain information other than just the changeset, then that balloons the amount of data you have to process on the receiving end.

On the other hand, you've already written them, so there may be less work involved. You have to write the "receiving" code either way.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜