Remove div that contains a specific class in html with php

Asked

Viewed 41 times

-1

Example:

$string = '<div class="teste"> Hello word </div> Hello pessoal';

I intend to remove the div that contains the test class and its contents.

  • 2

    Read about the classes DOMDocument and XPath.

1 answer

-1

Browser other questions tagged

You are not signed in. Login or sign up in order to post.