3v4l.org

run code in 300+ PHP versions simultaneously
<div div="first-slide"></div> <div div="container"></div> <?php htmlString = '<html>...</html>';//either generated, or loaded from a file $dom = new DOMDocument; $dom->loadHTML($htmlString);//or loadHTMLFile $divs = $dom->getElementsByTagName('div'); foreach($divs as $div) { if ($div->hasAttribute('class') && strstr($div->getAttribute('class'), 'first-slide')) { //$div ~= <div class='one-two-three'> $div->appendChild( echo '<div class="wrapper"></div>';);//check the docs to see what you can do } } ?>
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.28
Parse error: syntax error, unexpected '=' in /in/d6jZK on line 5
Process exited with code 255.

preferences:
175.22 ms | 1395 KiB | 65 Q