For example, add some script or style to head, or change the contents of the span in the code below?
<head></head><body><span>text</span></body> For example, add some script or style to head, or change the contents of the span in the code below?
<head></head><body><span>text</span></body> Almost from the enclosed examples
$html = str_get_html('<head></head><body><span>text</span></body>'); $html->find('head', 0)->innertext = '<script>alert("Test");</script>'; $html->find('span', 0)->innertext = 'New text'; Adding a script is also not difficult to implement:
$html->find('head', 0)->innertext .= '<script>alert("Test");</script>'; Ps. Pay attention to the point
Source: https://ru.stackoverflow.com/questions/489059/
All Articles