3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @link http://stackoverflow.com/questions/10543397/php-domnode-nodevalue-doesnt-work-properly */ $html = <<<HTML <option value="A26JUYT14N57PY">Aleksander&#39;s Kindle Cloud Reader</option> <option value="A13400OMTGFDRH">Aleksander&#39;s Kindle for PC</option> <optgroup label="----OR----" style="color:#999;font-style:normal;font-weight:normal"> </optgroup> <option value="add-new">Register a new Kindle</option> HTML; $dom = new DOMDocument(); $dom->loadHTML($html); $options = $dom->getElementsByTagName('option'); foreach($options as $option) { $attr = $option->getAttribute('value'); $value = $option->nodeValue; printf("%s : %s\n", $attr, $value); }
Output for git.master, git.master_jit, rfc.property-hooks
A26JUYT14N57PY : Aleksander's Kindle Cloud Reader A13400OMTGFDRH : Aleksander's Kindle for PC add-new : Register a new Kindle

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
40.32 ms | 401 KiB | 8 Q