3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<EOF <div id="box"> <tr align='center'> <td>1</td> <td style='padding-left: 0px !important;padding-right: 10px !important;'> <div id=''></div></td> <td>45</td> <td>62</td> </tr><tr align='center'> <td>2</td> <td style='padding-left: 0px !important;padding-right: 10px !important;'> <div id=''></div></td> <td>35</td> <td>47</td> </tr><tr align='center'> <td>3</td> <td style='padding-left: 0px !important;padding-right: 10px !important;'> <div id=''></div></td> <td>63</td> <td>58</td> </tr> EOF; $url = ''; $doc = new DOMDocument(); $doc->preserveWhiteSpace = FALSE; @$doc->loadHTML($html); $xpath = new DOMXpath ($doc); $expresion = "//div[@id='box']//tr"; $trs = $xpath->evaluate($expresion); foreach ($trs as $tr) { $tdvals = array(); foreach($xpath->query('td', $tr) as $td) { /* Skip the td with the empty text value */ if(trim($td->nodeValue) !== '') { $tdvals []= $td->nodeValue; } } echo implode(',', $tdvals) . PHP_EOL; }
Output for git.master, git.master_jit, rfc.property-hooks
1,45,62 2,35,47 3,63,58

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:
111.31 ms | 405 KiB | 5 Q