I am trying to make a simple script that choose a new xml entry every time the page is refreshed. you can think of it as an php/xml banner rotator... any ideas on this?
to what end? if you provide more information someone might be able to help. i.e. why is it in xml? why would you want a new xml entry on every refresh? after X hits you will have a huge file
sorry i should be more clear. i am trying not to pull from a database so say i have an xml file that has two text areas of code I want a php script that will read the first text area and present that code and then on refresh present the next text area of the xml file
ahh right ok well AFAIK the only way to pull xml data is using SAX, its kinda difficulty to understand but basically it iterates through each section in the XML and offers you the chance to deal with it. It might be better, in your case, to write a simple regex to pull out the data. Then use a random number to decide which one to pull. I.e. if you preg_match_all the data and it finds 2 matches [thatll be your two lots of text] itll return an array of the two text, simply create a random number between 0 and N-1 [where N is the number of matches] and your sorted!