http://www.pursue.ne.jp/jouhousyo/SQLDoc/select13.html
1 / 2| 次のページ »
ID:1190183282
ID:1189560932
ID:1189388325
ID:1189146072
ID:1188980926
<?xml version='1.0' standalone='yes'?>
<movies>
<movie>
<title>PHP: Behind the Parser</title>
<characters>
<character>
<name>Ms. Coder</name>
<actor>Onlivia Actora</actor>
</character>
<character>
<name>Mr. Coder</name>
<actor>El ActÓr</actor>
</character>
</characters>
<plot>
So, this language. It's like, a programming language. Or is it a
scripting language? All is revealed in this thrilling horror spoof
of a documentary.
</plot>
<rating type="thumbs">7</rating>
<rating type="stars">5</rating>
</movie>
</movies>
//$xml = file_get_contents($url); $xml = new SimpleXMLElement($xml); //ratingにアクセス foreach ($xml->movie[0]->rating as $rating) { echo $rating['type'];//属性出力(thumbsとstarsが出力される) echo $rating;//要素の中の値を出力(7と5が出力される) }
最近のコメント