Results 1 to 3 of 3
Thread: PHP, reading from an xml file
-
06-21-2010, 01:20 PM #1Junior Guru Wannabe
- Join Date
- Jun 2007
- Posts
- 73
PHP, reading from an xml file
Hello again,
I'm trying to set up an automated e-mail proccess to send me information about a proccess that is being logged, this is mostly irrelevent however here is the question anyways.
I hate data stored in an xml sheet like so
Code:<itemlog> <item id="1277106687900" name="name" time="Mon 06/21/10 12:21">"Some stuff </item> </itemlog>
I would like to open up the .xml file, probably using fopen and then read the file using fread and then display the data, probably in an array for the best use, ie
echo $itemID[0], $name[0], $time[0] and then the "some stuff part"
I'm sure there is a simple way to do this but searching hasn't gotten me and relevent results.Last edited by Shib; 06-21-2010 at 01:23 PM.
-
06-21-2010, 01:57 PM #2Web Hosting Master
- Join Date
- Jan 2006
- Location
- Athens, Greece
- Posts
- 1,481
Try simplexml
PHP Code:$xml = simplexml_load_string($string);
print_r($xml);
-
06-21-2010, 03:03 PM #3Junior Guru Wannabe
- Join Date
- Jun 2007
- Posts
- 73
Hmm thank you Steve,
Would it be to much to ask if you could quickly write a few lins of code that selects the item and then asigns its variables or point me in the right direction?
I understand if you say no,
Thanks regardless
Similar Threads
-
AJAX: Weird problem. (PHP-XML-> JS) XML not parsed properly
By monilchheda in forum Programming DiscussionReplies: 5Last Post: 05-23-2006, 11:52 AM -
Reading file
By UrlGuy in forum Programming DiscussionReplies: 6Last Post: 07-27-2005, 12:47 PM -
PHP: Reading file line by line
By UrlGuy in forum Programming DiscussionReplies: 11Last Post: 07-26-2005, 04:11 PM -
Need help with php/xml grabing info from xml sheet placing into php.
By rhinohost.net in forum Programming DiscussionReplies: 8Last Post: 04-07-2005, 04:50 AM -
Load a XML RSS Feed with a .php file to RSS Client
By Idezo in forum Programming TutorialsReplies: 1Last Post: 08-03-2004, 12:09 PM