I would like to use Simple HTML DOM to remove all images in an article so I can easily create a small snippet of text for a news ticker but I haven't figured out how to remove elements with it.
Basically I would do
Any help?
Approach: Select the HTML element which need to remove. Use JavaScript remove() and removeChild() method to remove the element from the HTML document.
Use offsetWidth & offsetHeight properties of the DOM element to get its the width and height.
The removeAttribute() method removes an attribute from an element.
There is no dedicated methods for removing elements. You just find all the img elements and then do
$e->outertext = '';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With