JSHINER Posted July 28, 2008 Share Posted July 28, 2008 I have an XML file that looks like this: <?xml version="1.0" encoding="UTF-8"?> <statuses type="array"> <status> <created_at>Sun Jul 27 23:33:54 +0000 2008</created_at> <id>870068374</id> <text>@markeckenrode so cool to meet ya'll. I hope you 2 had as much fun as Laurie and I did. See ya soon!</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id>870067417</in_reply_to_status_id> <in_reply_to_user_id>14297512</in_reply_to_user_id> <favorited></favorited> <user> <id>9919102</id> <name>mlbroadcast</name> <screen_name>mlbroadcast</screen_name> <location>iPhone: 37.769547,-122.411362</location> <description>I'm what Greg Swann Would Call a Vendor Without The "Sleazoid" Part</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/55575551/twitter_avatar_normal.jpg</profile_image_url> <url>http://www.mlpodcast.com/blog</url> <protected>false</protected> <followers_count>288</followers_count> </user> </status> <status> <created_at>Sun Jul 27 23:16:15 +0000 2008</created_at> <id>870058572</id> <text>@hthrflynn and @missycaulk I miss you guys already and I still need to unpack. Where are your pics located?</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id>870042065</in_reply_to_status_id> <in_reply_to_user_id>10854512</in_reply_to_user_id> <favorited></favorited> <user> <id>9919102</id> <name>mlbroadcast</name> <screen_name>mlbroadcast</screen_name> <location>iPhone: 37.769547,-122.411362</location> <description>I'm what Greg Swann Would Call a Vendor Without The "Sleazoid" Part</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/55575551/twitter_avatar_normal.jpg</profile_image_url> <url>http://www.mlpodcast.com/blog</url> <protected>false</protected> <followers_count>288</followers_count> </user> </status> How can I pull the data from there as variables to display. Link to comment https://forums.phpfreaks.com/topic/117003-solved-working-with-xml/ Share on other sites More sharing options...
Xurion Posted July 28, 2008 Share Posted July 28, 2008 Learn XML Parser Link to comment https://forums.phpfreaks.com/topic/117003-solved-working-with-xml/#findComment-601753 Share on other sites More sharing options...
obsidian Posted July 28, 2008 Share Posted July 28, 2008 What version of PHP are you running? If it's PHP5+, you can try using the SimpleXML extension, but if you're using PHP4, you'll need to build your own parser to know how to handle the tags and variables you are after. There are a number of good tutorials available on how to do this (like this one). Google will be your best friend on this one. Link to comment https://forums.phpfreaks.com/topic/117003-solved-working-with-xml/#findComment-601759 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.