3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <a class="profile-link" href="CompanyProfile.aspx?PID=4813&amp;country=211&amp;practicearea=0&amp;pagenum=" title="1-844-Iran-Law">Amin Alemohammad</a> HTML; $doc = new DOMDocument(); $doc->loadHTML($html); foreach($doc->getElementsByTagName('a') as $a) { if ($a->getAttribute('class') === 'profile-link') { $parts = explode('?', $a->getAttribute('href')); parse_str($parts[1], $output); echo 'Title: ' . $a->getAttribute('title') . '<br>'; echo 'Text: ' . $a->nodeValue . '<br>'; echo 'PID: ' . $output['PID']; // etc.. } }
Output for git.master_jit, git.master, rfc.property-hooks
Title: 1-844-Iran-Law<br>Text: Amin Alemohammad<br>PID: 4813

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