3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<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.4.28
Parse error: syntax error, unexpected '=' in /in/d6jZK on line 5
Process exited with code 255.