- 545 名前:nobodyさん [2008/03/14(金) 16:59:59 ID:P2EP3hdl]
- simplexml_load_fileを使い必要な部分を抜き出し下記のようなオブジェクトを取得しましたが
ループ文を使い値と属性を取得しようとすると、$nameという配列を作る行で Warning: Illegal offset type となります。オブジェクトの属性と値の取り方を間違えているのでしょうか? $xml SimpleXMLElement Object ( [id] => 2 [title] => hogehoge [spec] => 500 ) foreach($xml as $a => $b) { if ($a == 'id') { $id = $b; } if ($a == 'title') { $title = $b; } } $name[$id] = $title; ←エラー
|

|