Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

php and xml?

I have a problem is xml the solution?

7:00 pm on Oct 22, 2008 (gmt 0)

Preferred Member

10+ Year Member

joined:Apr 29, 2003
votes: 0

I'm working on building a site. All my product info for their individual product pages is in a text files.

My thoughts were to use php to splice the file and propagate all the pages.. normally I would just pull from a DB but that solution has been shot down from our DB manager.

I have 2 thoughts.

1. add XML tags of <productname><tagline><bodytext> to the xml file then parse getting the parts I need for each page.
However I'm thinking as this gets to be a big file that this might take too much time and memory to parse and store in the php code.

2. create an individual file for each product using the data i have. I think this would be the easiest and most efficient however if could make updating a real pain.... on the other there shouldn't be a lot of updating going on with this data maybe once a year... twice at the most.

4:54 pm on Nov 7, 2008 (gmt 0)

Senior Member

joined:Nov 12, 2005
votes: 0

Is there a good reason why you cannot use a DB? This would definitely be the better solution.

Also, it should use less memory allocation to use an event-based XML parser (eg Expat) instead of a tree-like one (eg SimpleXML).