I've loaded some html using DOMDocument as follows:
$dom = new DOMDocument();
$dom->loadHTML($somehtml);
foreach($dom->getElementsByTagName('*') as $element ){
if($element->getAttribute("type")=='radio') {
// I need to set the radio group checked value
}
}
There are 3 radio buttons in each group, all have the same name per group. How can I set a particular radio button's checked property to true? I assume I need to access a collection some how?