I've the following code:
$newDOM = new DOMDocument('1.0', 'utf-8');
$foo = $newDOM->createElement('Input', 'THIS IS MY VALUE');
$newDOM->appendChild($foo);
echo $newDOM->saveHTML();
This is what is outputted only: <Input>
But when I change the createElement to a 'div' it works okay
This is what is outputted with 'div' or any other input:
<div>THIS IS MY VALUE</div>
This is my var_dump($foo)
:
object(DOMElement)#5 (17) {
["tagName"]=>
string(5) "Input"
["schemaTypeInfo"]=>
NULL
["nodeName"]=>
string(5) "Input"
["nodeValue"]=>
string(16) "THIS IS MY VALUE"
["nodeType"]=>
int(1)
["parentNode"]=>
string(22) "(object value omitted)"
["childNodes"]=>
string(22) "(object value omitted)"
["firstChild"]=>
string(22) "(object value omitted)"
["lastChild"]=>
string(22) "(object value omitted)"
["previousSibling"]=>
NULL
["attributes"]=>
string(22) "(object value omitted)"
["ownerDocument"]=>
string(22) "(object value omitted)"
["namespaceURI"]=>
NULL
["prefix"]=>
string(0) ""
["localName"]=>
string(5) "Input"
["baseURI"]=>
NULL
["textContent"]=>
string(16) "THIS IS MY VALUE"
}