PHP: не читать все атрибуты XMLPhp

Кемеровские программисты php общаются здесь
Гость
PHP: не читать все атрибуты XML

Сообщение Гость »


For some reason, I can't read all the attributes. Here is the code:

$sTest = "TEST"; $xTest = simplexml_load_string( $sTest ); foreach( $xTest->book->attributes() as $k => $v ) { echo "'$k' = '$v'
"; } This returns:

'pages' = '273' 'test' = 'en' The second attribute has disappeared. If I use ...

echo htmlentities( $xTest->asXML() ); I get back:

TEST So the attribute is still there. How can I read it?


Источник: https://stackoverflow.com/questions/781 ... attributes

Вернуться в «Php»