PHP DOM在单选按钮之间添加新行


PHP DOM add new line between radio buttons

我想在单选按钮之间添加一行新行。

我可以向单选按钮添加文本,但"''n"的createTextNode确实有效。。。尽管'''n'显示在HTML上。。。但是"''n"既没有也没有换行。

$showXLS = new DOMDocument();
$showXLS->formatOutput = true;
$showXLS->preserveWhiteSpace = false;
$sXLSSpan = $showXLS->createElement('Span');
$showXLS->appendChild($sXLSSpan);
$sXLSSpan->setAttribute('id','saveOptions');
$sXLSSpan->setAttribute('style','VISIBILITY');
$sXLSDiv = $showXLS->createElement('Div');
$sXLSSpan->appendChild($sXLSDiv);
$sXLSDiv->setAttribute('id','showingOptions');
$sXLSDiv->setAttribute('align','right');
$sXLSForm = $showXLS->createElement('Form');
$sXLSDiv->appendChild($sXLSForm);
$sXLSForm->setAttribute('id','sXLSForm');
$sXLSForm->setAttribute('action','printTest.php');
$sXLSForm->setAttribute('method','POST');
$sXLSInput1Text = $showXLS->createElement('label','<b>Save Directory</b>');
$sXLSForm->appendChild($sXLSInput1Text);
$sXLSInput1Text->appendChild($showXLS->createTextNode("'n"));

$sXLSInput1 = $showXLS->createElement('input');
$sXLSInput1Text->appendChild($sXLSInput1);
$sXLSInput1->setAttribute('type','radio');
$sXLSInput1->setAttribute('name','save');
$sXLSInput1->setAttribute('value','saveDirectory');
$sXLSInput1->setAttribute('id','saveDirectory');

$sXLSInput2Text = $showXLS->createElement('label','Save Email');
$sXLSForm->appendChild($sXLSInput2Text);
$sXLSInput2Text->appendChild($showXLS->createTextNode("'n"));

///////////////此处为新行

$sXLSInput2 = $showXLS->createElement('input');
$sXLSInput2Text->appendChild($sXLSInput2);
$sXLSInput2->setAttribute('type','radio');
$sXLSInput2->setAttribute('name','save');
$sXLSInput2->setAttribute('value','saveEmail');
$sXLSInput2->setAttribute('onClick','getMore()');
<br/>
or
createElement("br");

''n在html 中没有任何值