Answer the question
In order to leave comments, you need to log in
What do the @ and # symbols mean when parsing an xml file?
I parse XML using Bitrix tools, I do
$objXML = new CDataXML();
$objXML->LoadString(file_get_contents('upload/importfile.xml'));
$arData = $objXML->GetArray();
array(1) {
["TradeInExport"]=>
array(2) {
["@"]=>
array(0) {
}
["#"]=>
array(1) {
["Car"]=>
array(143) {
[0]=>
array(2) {
["@"]=>
array(0) {
}
["#"]=>
array(27) {
["InSaleDate"]=>
array(1) {
[0]=>
array(2) {
["@"]=>
array(0) {
}
["#"]=>
string(10) "11.07.2015"
и т д
Answer the question
In order to leave comments, you need to log in
This is a feature of the GetArray method.
To get rid of them, you need to either collect the array yourself, or rebuild the existing one.
I rebuild like this:
foreach($arXml['feed']['#']['entry'] as $keyEntry => $arValue) {
foreach($arValue['#'] as $sKey => $sVal) {
if(is_array($sVal[0]['#']['properties'][0]['#'])) {
foreach($sVal[0]['#']['properties'][0]['#'] as $keyProp => $valProp){
$arResult[$keyEntry][$keyProp] = $valProp[0]['#'];
}
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question