By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,825 Members | 1,462 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,825 IT Pros & Developers. It's quick & easy.

easy PHP+XML parser

P: n/a


Hi,
I have data like:

<?xml version="1.0" encoding="ISO-8859-2"?>
<news>
<post>
<date>10.04.2004</date>
<text>Test test test</text>
</post>
<post>
<date>15.04.2004</date>
<text>Bleh bleh bleh <a href="www.test">test</a></text>
</post>
</news>

and I want to have it in PHP as array looking like:

array(
[0] =>
array(
date => "10.04.2004"
text => "Test test test"
)
[1] =>
array (
date => "15.04.2004"
text => "Bleh bleh bleh <a href="www.test">test</a>"
)
)

problem - text can have some HTML tags, so I want to just have it all in
string.

How can I do this in PHP if I have XML data in some data.xml ?

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~l-.~~~~~~~~~~~~~~~~~~~
GG-1175498 ____| ]____,
Rafal 'Raf256' Maj X-( * )
Rafal(at)Raf256(dot)com ,"----------"
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.