0

我得到了这个对象:

SimpleXMLElement Object\n(\n    
[@attributes] => Array\n        (\n            
  [article_number] => 550007\n        )\n\n    
[serial_number] => Array\n        (\n            
   [0] => 5500070000126237\n            
   [1] => 5500070000126246\n            
   [2] => 5500070000126255\n            
   [3] => 5500070000126264\n            
   [4] => 5500070000126273\n        )\n\n)\n

我想访问这样的属性,但它似乎不起作用:

foreach ($product_array as $codes) 
{    
    error_log($codes->product[0]->attributes()->article_number);    
}
4

1 回答 1

1
$codes->product[0]['article_number']

这应该有效。

于 2012-09-20T12:54:02.037 回答