3v4l.org

run code in 500+ PHP versions simultaneously
<?php $dom = new DOMDocument(); $dom->loadHtml(' <p class = "ft00">Introduction</p> <p class = "ft00">John Smith</p> <p class = "ft02">Email:</p> <p class = "ft00">John@gmail.com</p> <p class = "ft00">Work Experience</p> <p class = "ft00">27 July 2017</p> <p class = "ft02">ABC Company</p> <p class = "ft00">19 May 2018</p> <p class ="ft02">XYZ Company</p> <p class = "ft00">EDUCATION AND TRAINING</p> ', LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); $xpath = new DOMXPath($dom); $result = []; $matching = false; foreach ($xpath->query("//p[contains(@class, 'ft00') or contains(@class, 'ft02')]/text()") as $p) { if ($p->nodeValue === 'Work Experience' || $matching) { $result[] = $p->nodeValue; $matching = true; } } print_r($result);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Work Experience [1] => 27 July 2017 [2] => ABC Company [3] => 19 May 2018 [4] => XYZ Company [5] => EDUCATION AND TRAINING )

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:
101.14 ms | 1516 KiB | 4 Q