Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [XML][PHP]wyświetlenie danych
Forum PHP.pl > Forum > Przedszkole
Goldi
Witam,
jak wyświetlić dane z takiedo xml'a

Kod
<pasaz:Envelope>
<pasaz:Body>
<loadOffers>
<offers>
<offer>
<id>12002</id>
<name>Tretgtrerytr</name>
<price>147.00</price>
<url>http://www.tttt.pl/tt/</url>
<categoryId>Ksssss</categoryId>
<description></description>
<image>http://ttt.pl/600x848.jpg?20120301</image>
<attributes>
<attribute>
<name>zm:productTypeId</name>
<value>16</value>
</attribute>
<attribute>
<name>Autor</name>
<value>Luke Ryy</value>
</attribute>
<attribute>
<name>ISBN</name>
<value></value>
</attribute>
<attribute>
<name>Wyd</name>
<value>Zooo.</value>
</attribute>
<attribute>
<name>Rok</name>
<value>2011</value>
</attribute>
</attributes>
<availability>1</availability>
</offer>
</offers>
</loadOffers>
</pasaz:Body>
</pasaz:Envelope>


Pozdrawiam
ptq
Polecam zapoznanie się z simple xml.
Goldi
Prosze mi pomóc....
Próbuje, próbuje i nie działa...
jackraymund
  1. function GetBetween ($text, $s1, $s2) {
  2. $mid_url = "";
  3. $pos_s = strpos($text,$s1);
  4. $pos_e = strpos($text,$s2);
  5. for ( $i=$pos_s+strlen($s1) ; (( $i<($pos_e)) && $i < strlen($text)) ; $i++ ) {
  6. $mid_url .= $text[$i];
  7. }
  8. return $mid_url;
  9. }

ladujesz ten caly ciag do zmiennej $text, $s1 ustawiasz np. <name> a $s2 ustawiasz </name> i zwroci ci Rok
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.