Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [XML][PHP]wyświetlenie danych
Goldi
post 4.03.2012, 13:28:52
Post #1





Grupa: Zarejestrowani
Postów: 25
Pomógł: 0
Dołączył: 12.01.2009

Ostrzeżenie: (0%)
-----


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
Go to the top of the page
+Quote Post
ptq
post 4.03.2012, 13:37:34
Post #2





Grupa: Zarejestrowani
Postów: 44
Pomógł: 2
Dołączył: 25.08.2009

Ostrzeżenie: (0%)
-----


Polecam zapoznanie się z simple xml.


--------------------
Jeżeli czegoś się nie da zrobić,
daj to do zrobienia komuś kto o tym nie wie,
na pewno to zrobi...
Go to the top of the page
+Quote Post
Goldi
post 11.03.2012, 15:35:18
Post #3





Grupa: Zarejestrowani
Postów: 25
Pomógł: 0
Dołączył: 12.01.2009

Ostrzeżenie: (0%)
-----


Prosze mi pomóc....
Próbuje, próbuje i nie działa...
Go to the top of the page
+Quote Post
jackraymund
post 11.03.2012, 21:44:54
Post #4





Grupa: Zarejestrowani
Postów: 217
Pomógł: 21
Dołączył: 10.06.2011
Skąd: Głogów

Ostrzeżenie: (0%)
-----


  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

Ten post edytował jackraymund 11.03.2012, 21:46:44


--------------------
Wykonuje zlecenia na pobieranie danych ze stron i różne boty.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 16.06.2025 - 19:44