Ú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