I go through the xml definition file and I have a DOMNodeList that I am viewing. I need to extract the contents of a child tag, which may or may not be in the current object
<input id="name"> <label>Full Name:</label> <required /> </input> <input id="phone"> <required /> </input> <input id="email" />
I need to replace ?????????????? with something that will deliver me the contents of the tag tag, if one exists.
the code:
foreach($dom->getElementsByTagName('required') as $required){ $curr = $required->parentNode; $label[$curr->getAttribute('id')] = ????????????? }
Expected Result:
Array( ['name'] => "Full Name:" ['phone'] => )
dom xml php
Tyson of the northwest
source share