I want to remove the element tag in my domdocument html.
I have something like
this is the <a href='#'>test link</a> here and <a href='#'>there</a>.
I want to change my html to
this is the test link here and there.
My code
$dom = new DomDocument();
$dom->loadHTML($html);
$atags=$dom->getElementsByTagName('a');
foreach($atags as $atag){
$value = $atag->nodeValue;
//I can get the test link and there value but I don't know how to remove the a tag.
}
Thanks for the help!