Hirdetés
Új hozzászólás Aktív témák
-
DiabloCorsa
őstag
válasz
fordfairlane
#18164
üzenetére
Köszönöm ez működne "hagyományos" XML esetén.
Jelen esetben nem ad vissza értéket.Én most itt tartok:
Ez az XML
<?xml version="1.0" encoding="UTF-8"?><diponibility>
<products>
<product code="ce0101000499090" generic="01010004" title="JAY kombinált kesztyű sárga kék - 9" totalDispo="0" unit="PÁR">
<detail dispo="0" site="Budapest"/>
<detail dispo="1 000 - 2 999" site="Központi raktár"/>
</product>
<product code="0101000499100" generic="01010004" title="JAY kombinált kesztyű - 10" totalDispo="10 - 29" unit="PÁR">
<detail dispo="10 - 29" site="Budapest"/>
<detail dispo="5 000 - 9 999" site="Központi raktár"/>
</product>
<product code="0101000499110" generic="01010004" title="JAY komb. kesztyű sárga piros -11" totalDispo="0" unit="PÁR">
<detail dispo="0" site="Budapest"/>
<detail dispo="10 000 - 19 999" site="Központi raktár"/>
</product>
</products>
</diponibility>Ebből evvel:
foreach($xml->products as $prod) {
print_r($prod);
}
Ez lesz:SimpleXMLElement Object ( [product] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [code] => ce0101000499090 [generic] => 01010004 [title] => JAY kombinĂĄlt kesztyĹą sĂĄrga kĂŠk - 9 [totalDispo] => 0 [unit] => PĂR ) [detail] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [dispo] => 0 [site] => Budapest ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [dispo] => 1 000 - 2 999 [site] => KĂśzponti raktĂĄr ) ) ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [code] => 0101000499100 [generic] => 01010004 [title] => JAY kombinĂĄlt kesztyĹą - 10 [totalDispo] => 10 - 29 [unit] => PĂR ) [detail] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [dispo] => 10 - 29 [site] => Budapest ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [dispo] => 5 000 - 9 999 [site] => KĂśzponti raktĂĄr ) ) ) ) [2] => SimpleXMLElement Object ( [@attributes] => Array ( [code] => 0101000499110 [generic] => 01010004 [title] => JAY komb. kesztyĹą sĂĄrga piros -11 [totalDispo] => 0 [unit] => PĂR ) [detail] => Array ( [0] => SimpleXMLElement Object ( [@attributes] => Array ( [dispo] => 0 [site] => Budapest ) ) [1] => SimpleXMLElement Object ( [@attributes] => Array ( [dispo] => 10 000 - 19 999 [site] => KĂśzponti raktĂĄr ) ) ) ) ) )
Ebből kell kivenni az adatot. Hogyan?
Új hozzászólás Aktív témák
- LG 27GR95QE - 27" OLED / QHD 2K / 240Hz & 0.03ms / NVIDIA G-Sync / FreeSync Premium / HDMI 2.1
- Eredeti Microsoft Windows 10 / 11 Pro OEM licenc Akciós áron! 64/32 bit Azonnali kézbesítéssel
- Lenovo ThinkPad T14 Gen1 Ryzen5 4650U Refurbished - Garancia
- Samsung Galaxy A71 128GB, Kártyafüggetlen, 1 Év Garanciával
- Xiaomi Redmi Note 13 256GB, Kártyafüggetlen, 1 Év Garanciával
Állásajánlatok
Cég: BroadBit Hungary Kft.
Város: Budakeszi
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


