<?php
$dom_xml = new domDocument();
$xml= <<<XML
<car>
<model>volvo</model>
<model>Lada</model>
<fdsdf>Lada</fdsdf>
<qwqw>Lada</qwqw>
<model>Lada</model>
<fdsdfsdfs>Lada</fdsdfsdfs>
<sd>ASD</sd>
<bv>213</bv>
</car>
XML;
$dom_xml->LoadXml($xml);
$dom_xml->formatOutput = TRUE;
$car = $dom_xml->getElementsByTagName("car")->item(0);
$car_childs = $car->childNodes;
$dom_items = $dom_xml->createElement('items');
foreach($car_childs as $mod){
if($mod->tagName != null){
$dom_element = $dom_xml->createElement($mod->tagName, $mod->nodeValue);
$dom_items ->appendChild($dom_element);
}
}
$dom_xml ->appendChild($dom_items );
//удаляем узел car
//$dom_xml->removeChild($car);
$xml= $dom_xml->save('new.xml')
<?xml version="1.0"?>
<car>
<model>volvo</model>
<model>Lada</model>
<fdsdf>Lada</fdsdf>
<qwqw>Lada</qwqw>
<model>Lada</model>
<fdsdfsdfs>Lada</fdsdfsdfs>
<sd>ASD</sd>
<bv>213</bv>
</car>
<items>
<model>volvo</model>
<model>Lada</model>
<fdsdf>Lada</fdsdf>
<qwqw>Lada</qwqw>
<model>Lada</model>
<fdsdfsdfs>Lada</fdsdfsdfs>
<sd>ASD</sd>
<bv>213</bv>
</items>
$params = [
':id' => '',
':name' => $data['name'],
':sname' => $data['sname'],
':email' => $data['email'],
':password' => password_hash($data['password'], PASSWORD_DEFAULT),
':datetime' => date("Y-m-d H:i:s",time()),
':confirm' => 0,
':avatar' => $Avatar,
':detect' => $detect,
':wallpaper' => $wallpaper,
':detectp' => 3,
':activation' => $activation,
':country' => $data['country_id'],
':about' => $data['about'],
':birthday' => $data['birthday_year'].'-'.$data['birthday_month'].'-'.$data['birthday_day'],
':sex' => $data['select'],
':ref' => $ref
];
Пролазил пол дня на форумах - написал mailer php такой
<?php
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
<?php Excerpt::getPOST(); ?>
оно здесь не нужно. В точке вызова класса Excerpt всегда, что бы я не кликал, висит "POST is not set".
success: function(data){
//console.log('success'+'\n'+'data =>'+data);
// вот тут можно какие-то действия производить
// например вывести то что пришло через алерт
alert(data);
},