Skip to content

Instantly share code, notes, and snippets.

@l3l0
Last active October 29, 2015 08:50
Show Gist options
  • Select an option

  • Save l3l0/848f11be090e3c3444a8 to your computer and use it in GitHub Desktop.

Select an option

Save l3l0/848f11be090e3c3444a8 to your computer and use it in GitHub Desktop.
<?php
$xmlString = <<<XML
<ul>
<li class="applicationDate">
<strong>Data aplikacji: </strong>
"
19/10/15
"
</li>
<li class="applicationDate">
<strong>Data aplikacji: </strong>
"
20/10/15
"
</li>
</ul>
XML;
$xml = simplexml_load_string($xmlString);
$nodes = $xml->xpath('//li[contains(concat(" ", normalize-space(@class), " "), " applicationDat
e ")]');
foreach ($nodes as $node) {
echo trim(str_replace(['"', ' '] , '', $node))."\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment