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.4.0 - 5.4.28
Parse error: syntax error, unexpected 'echo' (T_ECHO), expecting ')' in /in/3Fh2a on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_ECHO, expecting ')' in /in/3Fh2a on line 14
Process exited with code 255.