3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "<td class='postac'>Actelsar </td> <td class='postac'>tabl. 80 mg 28 tabl.</td> <td class='postac'> 3 &lt; 4</td><td class=\"postac\"> or <td class= 'postac'> or <td class='postac' > or <td class='postac' id='foo'> or <td class='postac'>"; preg_match_all("/<td class='postac'>([^<]+)</", $str,$m); $doc = new DOMDocument(); $doc->loadHTML($str); $xpath = new DOMXPath($doc); $nodes = $xpath->query('//td[@class="postac"]'); $result = array(); for($i=0;$i<$nodes->length; $i++){ $result[]=$nodes->item($i)->textContent; } print_r($m[1]); print_r($result); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Actelsar [1] => tabl. 80 mg 28 tabl. [2] => 3 &lt; 4 ) Array ( [0] => Actelsar [1] => tabl. 80 mg 28 tabl. [2] => 3 < 4 [3] => or [4] => or [5] => or [6] => or [7] => )

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