function wr ($teg, $value, $book=false, $tegStart=false, $teg2 =false, $teg3 = false) {
global $xml;
if ($value == false) {
return NULL;
}
if ($book == false) {
if ($teg2 == false) {
$xml->writeElement($teg, $value);
} else {
return array (
$xml->startElement($tegStart),
$xml->writeElement($teg, $value),
$xml->writeElement($teg2, $teg3),
$xml->endElement(),
);
}
} else {
if ($teg2 == false) {
return $xml->writeElement($teg, $book[$value]);
} else {
return array (
$xml->startElement($tegStart),
$xml->writeElement($teg, $book[$value]),
$xml->writeElement($teg2, $teg3),
$xml->endElement(),
);
}
}
}
$xml->startElement("price"); //цена
$xml->writeElement("value",$aRes['price']));
$xml->writeElement("currency","RUR");
$xml -> endElement();
write("Price", $data['price'], $colorist);
function wr ($teg, $value, $book=false) {
global $xml;
if ($value == false) {
return NULL;
}
if ($book == false) {
return $xml->writeElement($teg, $value);
} else {
return $xml->writeElement($teg, $colorist[$value]);
}
}
function wr ($teg, $value, $book=false) {
global $book, $value, $xml, $teg;
if ($value == false) {
return NULL;
}
if ($book == false) {
return $xml->writeElement($teg, $value);
} else {
return $xml->writeElement($teg, $colorist[$value]);
}
}
function wr ($teg, $value, $book=false) {
global $book, $value, $xml, $teg;
if ($value == false) {
return NULL;
}
if ($book == false) {
return $xml->writeElement($teg, $value);
} else {
return $xml->writeElement($teg, $colorist[$value]);
}
}
function wr ($teg, $value, $book=false) {
global $book, $value, $xml, $teg;
if ($value == false) {
return NULL;
}
if ($book == false) {
return $xml->writeElement($teg, $value);
} else {
return $xml->writeElement($teg, $colorist[$value]);
}
}
// если нет справочника я хотел бы так записывать
write("Price", $data['price']);
// пробовал так
write("Price", false, $data['price']);