Topic: SimpleXMLElement Basics'ai

Sveiki,

Senai nieko nerašiau / neklausiau tai pasinaudosiu proga, - parašysiu ir paklausiu. :)

Turiu tokį dump'ą:

object(SimpleXMLElement)[102]
  public '@attributes' => 
    array (size=6)
      'id' => string '75' (length=2)
      'name' => string 'OddService' (length=10)
      'isLive' => string 'false' (length=5)
      'lastUpdate' => string '2013-11-28T20:41:46.913' (length=23)
      'bookieEventID' => string '' (length=0)
      'bookieLeagueID' => string '' (length=0)
  public 'Odds' => 
    array (size=3)
      0 => 
        object(SimpleXMLElement)[103]
          public '@attributes' => 
            array (size=7)
              'bet' => string '1' (length=1)
              'startPrice' => string '1.57' (length=4)
              'currentPrice' => string '1.57' (length=4)
              'line' => string '' (length=0)
              'LastUpdate' => string '2013-11-28T20:41:46.913' (length=23)
              'bookieOutcomeID' => string '' (length=0)
              'Status' => string 'Open' (length=4)
      1 => 
        object(SimpleXMLElement)[105]
          public '@attributes' => 
            array (size=7)
              'bet' => string '2' (length=1)
              'startPrice' => string '1.57' (length=4)
              'currentPrice' => string '1.57' (length=4)
              'line' => string '' (length=0)
              'LastUpdate' => string '2013-11-28T20:41:46.913' (length=23)
              'bookieOutcomeID' => string '' (length=0)
              'Status' => string 'Open' (length=4)
      2 => 
        object(SimpleXMLElement)[104]
          public '@attributes' => 
            array (size=7)
              'bet' => string 'X' (length=1)
              'startPrice' => string '1.66' (length=4)
              'currentPrice' => string '1.66' (length=4)
              'line' => string '' (length=0)
              'LastUpdate' => string '2013-11-28T20:41:46.913' (length=23)
              'bookieOutcomeID' => string '' (length=0)
              'Status' => string 'Open' (length=4)

Kai padarau:

var_dump($Bookmaker->Odds);

Gaunu:

object(SimpleXMLElement)[103]
  public '@attributes' => 
    array (size=7)
      'bet' => string '1' (length=1)
      'startPrice' => string '1.57' (length=4)
      'currentPrice' => string '1.57' (length=4)
      'line' => string '' (length=0)
      'LastUpdate' => string '2013-11-28T20:41:46.913' (length=23)
      'bookieOutcomeID' => string '' (length=0)
      'Status' => string 'Open' (length=4)

Tai nelabai suprantu, kaip jis iš trijų man išdumpina tik vieną? :/
Countinant grąžina 3-s, xdebug'o lenght'as normaliai nustatytas ir masyvus grąžiai dumpina ir t.t.

Pats galvoju gal neteisingai pasiimu kažkaip patį Odds property tai noriu pasiteirauti kaip reikėtų teisingai tokiu atveju pasiimti.
Taip pat įdomus dalykas jog iteruojant per loop'ą kažkodėl elemento index'as, - 0, kitaip apsiverkia error'ais.

Dėkui. :)


Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 811

Deprecated: Function create_function() is deprecated in /home/pasokime/domains/mysql.lt/public_html/forumas/include/parser.php on line 816

Re: SimpleXMLElement Basics'ai

http://us2.php.net/manual/en/simplexml. … -basic.php

XML != array

Kiek maigyklių sudėvėjai ?

Re: SimpleXMLElement Basics'ai

O, dėkui, kažko panašaus ir ieškojau tik nelabai sekėsi rasti. :)