function format($size){
$filesizename = array( " Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB" );
return $size ?
$format = round($size/pow(1024, ($i = floor(log($size, 1024)))), 2) . $filesizename[$i] : '0 ' . $filesizename[0];
return format;
}
$login = $dom->createElementNS("g:id", '456');
<?php
$dom = new domDocument("1.0", "utf-8");
$root = $dom->createElement("channel");
$root ->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:g', 'http://base.google.com/ns/1.0');
$dom->appendChild($root);
$item = $dom->createElement("item");
$login = $dom->createElement("login", '123');
$item->appendChild($login);
$login = $dom->createElement("g:id", '456');
$item->appendChild($login);
$root->appendChild($item);
$dom->save("users.xml");
?>