Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

wyciaganie danych z xml

0 views
Skip to first unread message

mmiarecka

unread,
Nov 20, 2009, 4:12:27 AM11/20/09
to
Witajcie,

Mam taki xml:

<item rdf:about="http://jakis-link.pl">
<title>tytul</title>
<link>http://www.inny-link.pl</link>
<description>opis</description>
<dc:creator>creator</dc:creator>
<dc:subject>subject</dc:subject>
<dc:date>2009-11-19T22:46:02Z</dc:date>
</item>

I nie wiem, jak wyciagnac dane z <dc:date>. Bede wdzieczna za pomoc

Andrzej Kmicic

unread,
Nov 20, 2009, 6:48:59 AM11/20/09
to
mmiarecka pisze:

moze tak :

<?php
$xml="<item rdf:about=\"http://jakis-link.pl\">


<title>tytul</title>
<link>http://www.inny-link.pl</link>
<description>opis</description>
<dc:creator>creator</dc:creator>
<dc:subject>subject</dc:subject>
<dc:date>2009-11-19T22:46:02Z</dc:date>

</item>";

$dom = new domDocument;
$dom->loadXML($xml);
if (!$dom) {
echo 'Error while parsing the document';
exit;
}
$s = simplexml_import_dom($dom);
echo $s->date;
?>

pozdr
AK

0 new messages