Witam,
mam taki problem, z wyciąganiem ogłoszeń z XML, prosto mówiąc wyciąga mi tylko jedno ogłoszenie z XML a nie wszystkie,

PLIK: XML
  1. <Klient>
  2. <Id>3</Id>
  3. <Oferty>
  4. <Oferta>
  5. <ID>109028</ID>
  6. <Kategoria>dom</Kategoria>
  7. <Operacja>Wynajem</Operacja>
  8. <exclusive>0</exclusive>
  9. <Miasto>Warszawa</Miasto>
  10. ....
  11. </Oferta>
  12. <Oferta>
  13. ......
  14. </Oferta>
  15. </Oferty>
  16. </Klient>
  17.  


Domyślam się że powodem może być foreach ($product->Klient->Oferty->Oferta as $Oferta) zle napisany prosze o radę, pomoc

PLIK: PHP
  1. $product = simplexml_load_file ($hurtownia[0]);
  2.  
  3. foreach ($product->Klient->Oferty->Oferta as $Oferta)
  4. {
  5. $thisDom = array (
  6. 'kategoria' => $Oferta->Kategoria,
  7. .....
  8. 'opis'=> $Oferta->Opis= iconv("UTF-8","ISO-8859-2", nl2br($Oferta->Opis))
  9. );
  10. $request[] = $thisDom;
  11. }
  12. echo '<pre>';
  13. print_r($request);
  14. echo '</pre>';