3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str='<div class="table tbl-process-mobile"> <div class="table-cn"> <div class="table-bd"> <table cellspacing="0" id="idd7"> <thead> <tr id="idd9"> <th scope="col"> <span>username</span> </th> <th scope="col"> <span>status</span> </th> <th scope="col"> <span>prefered number</span> </th> <th scope="col"> <span>action</span> </th> </tr> </thead> <tbody id="iddb"> <tr class="even"> <td class="even"> <div>randomusername</div> </td><td class="odd"> <div>0123456789</div> </td><td class="even"> <div>active</div> </td><td class="odd"> <div> <span id="iddc" style="display:none"></span> <a href="xyz" id="idb2"><span>set number</span></a> </div> </td><td class="even"> <div> <a id="iddd" style="display:none"></a> <a href="xyz" class="action-icon-edit" id="idb3" title="change"> <i>change</i> </a> <a href="xyz" class="action-icon-delete" id="idb4" title="delete"> <i>delete</i> </a> </div> </td> </tr><tr class="odd"> <td class="even"> <div>randomusername2</div> </td><td class="odd"> <div>0987654321</div> </td><td class="even"> <div>active</div> </td><td class="odd"> <div> <span id="idde" style="display:none"></span> <a href="xyz" id="idb5"><span>set number</span></a> </div> </td><td class="even"> <div> <a id="iddf" style="display:none"></a> <a href="xyz" class="action-icon-edit" id="idb6" title="change"> <i>change</i> </a> <a href="xyz" class="action-icon-delete" id="idb7" title="delete"> <i>delete</i> </a> </div> </td> </tr> </tbody> </table> </div> </div> </div>'; $dom = new DOMDocument; $dom->loadHTML($str); $trs = $dom->getElementById("iddb")->getElementsByTagName("tr"); $arr = []; foreach($trs as $key=>$tr){ $tds = $tr->getElementsByTagName("td"); $arr[$key] = [ $tds->item(0)->textContent, $tds->item(1)->textContent, $tds->item(2)->textContent ]; } print_r($arr); ?>
Output for git.master, git.master_jit
/bin/php-git-master: error while loading shared libraries: libonig.so.5: cannot open shared object file: No such file or directory
Process exited with code 127.
Output for rfc.property-hooks
Array ( [0] => Array ( [0] => randomusername [1] => 0123456789 [2] => active ) [1] => Array ( [0] => randomusername2 [1] => 0987654321 [2] => active ) )

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:
67.89 ms | 401 KiB | 8 Q