ホームページ  >  記事  >  バックエンド開発  >  このような XML をループする方法

このような XML をループする方法

WBOY
WBOYオリジナル
2016-06-23 13:59:431010ブラウズ

SimpleXMLElement Object(    [date] => Array        (            [0] => 周五(今天, 实时:25)            [1] => 周六            [2] => 周日            [3] => 周一        )    [dayPictureUrl] => Array        (            [0] => http://api.map.baidu.com/images/weather/day/qing.png            [1] => http://api.map.baidu.com/images/weather/day/qing.png            [2] => http://api.map.baidu.com/images/weather/day/qing.png            [3] => http://api.map.baidu.com/images/weather/day/duoyun.png        )    [nightPictureUrl] => Array        (            [0] => http://api.map.baidu.com/images/weather/night/qing.png            [1] => http://api.map.baidu.com/images/weather/night/qing.png            [2] => http://api.map.baidu.com/images/weather/night/duoyun.png            [3] => http://api.map.baidu.com/images/weather/night/duoyun.png        )    [weather] => Array        (            [0] => 晴            [1] => 晴            [2] => 晴转多云            [3] => 多云        )    [wind] => Array        (            [0] => 北风3-4级            [1] => 南风微风            [2] => 南风微风            [3] => 南风微风        )    [temperature] => Array        (            [0] => 24 ~ 9            [1] => 21 ~ 10            [2] => 23 ~ 12            [3] => 22 ~ 11        ))

このような XML データをループして配列に入れる方法 array(array('date'=>'','dayPictureUrl'=>'','nightPictureUrl'=>'','weather'= > ));


ディスカッションに返信 (解決策)

SimpleXMLElement オブジェクトをフォーマットしますか? (配列) SimpleXMLElement オブジェクト

熱心にご協力いただきありがとうございます

声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。