php - Can i get XML values where XML value is greater than some number? -
i getting xml feeds xml soccer feeder , i want select values xml feed id greater last id database...
how can that? there linq in .net can select condition? i know phplinq, there better idea without framework?
something this:
$fixtures= $this->soccer->getfixturesbydateinterval( array("startdatestring"=>$start,"enddatestring"=>$end))->match->id->where(match->id > $number);
this few feeds var_dump $fixtures without match->id->where etc...
object(simplexmlelement)[5] public 'match' => array (size=11) 0 => object(simplexmlelement)[6] public 'id' => string '348257' (length=6) public 'date' => string '2015-06-19t00:00:00+00:00' (length=25) public 'league' => string 'brasileirao' (length=11) public 'round' => string '8' (length=1) public 'hometeam' => string 'figueirense' (length=11) public 'hometeam_id' => string '922' (length=3) public 'awayteam' => string 'internacional' (length=13) public 'awayteam_id' => string '736' (length=3) public 'location' => string 'orlando scarpelli' (length=17) 1 => object(simplexmlelement)[7] public 'id' => string '348051' (length=6) public 'date' => string '2015-06-18t17:20:00+00:00' (length=25) public 'league' => string 'superettan' (length=10) public 'round' => string '14' (length=2) public 'hometeam' => string 'degerfors' (length=9) public 'hometeam_id' => string '1193' (length=4) public 'awayteam' => string 'syrianska' (length=9) public 'awayteam_id' => string '593' (length=3) public 'location' => string 'stora valla' (length=11)
you should use xpath. example, if want select rows id attribute greater x:
$rows = $xml->xpath("//row[@id>x]");
Comments
Post a Comment