silverbullet126 Posted August 31, 2006 Share Posted August 31, 2006 Hey all,I did some searching and really didn't find anything that helped. I know somewhat how to get an xml file to show on the page, but not how to get a specific part of the data out. Here is what i'm looking for:--On Now$show_name_on_nowComing Up3:30pm - $show_name_30min4:00pm - $show_name_1hr4:30pm - $show_name_130min5:00pm - $show_name_2hr--Here is the format of my XML file. I've got the time and date formated and rounding correctly, no problem there .. but searching through an XML file ... i got nothing ???<synweek> <starttime>06:00:00</starttime> <title>Good Dog</title> <subepis>Preventing Problems</subepis> <air_date>08/28/06</air_date> <house>G</house> <synopsis>Great show bah bah..</synopsis></synweek>--I need to be able to continually pick out the show title based on the current date/time of the day. The sql file holds an entire week of data... anyone have any thoughts ? I could do this in a second if it was just an SQL database, but with XML I'm totally lost :( Quote Link to comment Share on other sites More sharing options...
pmeasham Posted August 31, 2006 Share Posted August 31, 2006 Their are two main methods to read xml sax and dom. sax reads through xml and allows you grabs it data. dom loads the xml into an object for you to access, like javascript interacting with HTML.PHP has expat to read xml which is sax like:http://uk2.php.net/xmlpear has a easier verson of this in:http://pear.php.net/manual/en/package.xml.xml-parser.example.phpmore detailed example:http://www.schst.net/index.php?__path=articles.xml-parser Quote Link to comment Share on other sites More sharing options...
Barand Posted August 31, 2006 Share Posted August 31, 2006 If you have php5, look at [url=http://"http://us2.php.net/simplexml"]simpleXML[/url] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.