fork(1) download
  1. <?php
  2.  
  3. $xml = simplexml_load_file('php://stdin');
  4.  
  5. '未キャスト' => $xml->Feature->Property->WeatherList->Weather[1]->Date,
  6. 'キャスト済み' => (string)$xml->Feature->Property->WeatherList->Weather[1]->Date,
  7. ]);
Success #stdin #stdout 0.02s 20568KB
stdin
<YDF xmlns="http://o...content-available-to-author-only...s.jp/ydf/1.0" firstResultPosition="1" totalResultsAvailable="1" totalResultsReturned="1">
<ResultInfo>
<Count>1</Count>
<Total>1</Total>
</ResultInfo>
<Feature>
<Id>201210191610_139.73229_35.663613</Id>
<Geometry>
<Type>point</Type>
<Coordinates>139.73229,35.663613</Coordinates>
</Geometry>
<Property>
<WeatherAreaCode>4410</WeatherAreaCode>
<WeatherList>
<Weather>
<Type>observation</Type>
<Date>201210191610</Date>
<Rainfall>1.65</Rainfall>
</Weather>
<Weather>
<Type>forecast</Type>
<Date>201210191620</Date>
<Rainfall>0.00</Rainfall>
</Weather>
<Weather>
<Type>forecast</Type>
<Date>201210191630</Date>
<Rainfall>0.00</Rainfall>
</Weather>
</WeatherList>
</Property>
</Feature>
</YDF>
stdout
array(2) {
  ["未キャスト"]=>
  object(SimpleXMLElement)#2 (1) {
    [0]=>
    string(12) "201210191620"
  }
  ["キャスト済み"]=>
  string(12) "201210191620"
}