PHP: не читать все атрибуты XML ⇐ 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
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
Мобильная версия