这是$v
其中包含对象的转储
object(SimpleXMLElement)[69]
public '@attributes' =>
array
'identifier' => string 'FC7C5117-8FF9-4FF4-86D2-F139EDE6EA74-19726-00011178F6D7A5AC' (length=59)
'fileext' => string 'pdf' (length=3)
public 'title' => string 'The PDF File' (length=12)
public 'summary' => string 'Summary for the pdf file stuff' (length=30)
public 'tags' =>
object(SimpleXMLElement)[70]
public 'tag' => string 'PDFTag' (length=6)
public 'timeSignature' =>
object(SimpleXMLElement)[71]
public '@attributes' =>
array
'upper' => string '4' (length=1)
'lower' => string '4' (length=1)
public 'key' => string 'C' (length=1)
public 'transposition' => string 'PDF Trans' (length=9)
public 'bpm' => string '120' (length=3)
public 'defaultAudio' => string '57895336-6D03-41B4-954C-91DA3F512185-19726-00011178DFE613C5' (length=59)
我愿意
foreach ($v as $k1 => $v1)
{
var_dump($k1);
var_dump($v1);
}
它从title
title
object(SimpleXMLElement)[74]
string 'The PDF File' (length=12)
summary
object(SimpleXMLElement)[72]
string 'Summary for the pdf file stuff' (length=30)
tags
object(SimpleXMLElement)[74]
public 'tag' => string 'PDFTag' (length=6)
timeSignature
object(SimpleXMLElement)[72]
public '@attributes' =>
array
'upper' => string '4' (length=1)
'lower' => string '4' (length=1)
key
object(SimpleXMLElement)[74]
string 'C' (length=1)
transposition
object(SimpleXMLElement)[72]
string 'PDF Trans' (length=9)
bpm
object(SimpleXMLElement)[74]
string '120' (length=3)
defaultAudio
object(SimpleXMLElement)[72]
string '57895336-6D03-41B4-954C-91DA3F512185-19726-00011178DFE613C5' (length=59)
我错过了什么?为什么会跳过@attributes
?