PHP and XML

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
narolis
Forum Newbie
Posts: 9
Joined: Tue Feb 10, 2009 4:36 pm

PHP and XML

Post by narolis »

Hi,
I am developing a website with users using some XML.

I would like to know what is the best and must optimized way to read and write XML with PHP. Currently I made some test with " new DOMDocument();" it work well but is it the best way to do it?

And is it best to read a big XML that contain many info or to split it in many little XML that contain less info, and to read them one after the other?

And do you have any good tips of PHP optimizations, what not to do or use and what to make to optimize.

One last question, what happen if a user must update an XML and at the same time an other user must write in the same XML? It will create a conflict, anyone have ideas to solve that problem?

Thank you
mbdigital
Forum Newbie
Posts: 21
Joined: Tue Feb 10, 2009 7:32 am
Location: NorthWest, England

Re: PHP and XML

Post by mbdigital »

Have a look at the php simple xml functions, they're pretty good for rapidly parsing and sorting through xml strings and files. Is your xml stored as static files or database entries?
narolis
Forum Newbie
Posts: 9
Joined: Tue Feb 10, 2009 4:36 pm

Re: PHP and XML

Post by narolis »

My XML are not static the entries change all the time. They are created by the data in a database.

That is why I want to know what to do to solve the problem, if two users update, read or write in the same XML file at the same time.
Post Reply