title: How to get string after xpath
body: <p>I have this html page:</p>
  
  <pre><code>&lt;div class="table_container p402_hide " id="div_Summer"&gt;
  &lt;table class=" stats_table" id="Summer"&gt;
  &lt;colgroup&gt;&lt;col&gt;&lt;col&gt;&lt;col&gt;&lt;col&gt;&lt;col&gt;&lt;col&gt;&lt;col&gt;&lt;col&gt;&lt;col&gt;&lt;/colgroup&gt;
  &lt;thead&gt;
  &lt;tr class=""&gt;
    &lt;th data-stat="year" align="right"  class=" sort_default_asc" &gt;Year&lt;/th&gt;
    &lt;th data-stat="city" align="left"  class=" sort_default_asc" &gt;City&lt;/th&gt;
    &lt;th data-stat="country" align="left"  class=" sort_default_asc" &gt;Country&lt;/th&gt;
    &lt;th data-stat="countries" align="right"  class="" &gt;Countries&lt;/th&gt;
    &lt;th data-stat="participants" align="right"  class="" &gt;Participants&lt;/th&gt;
    &lt;th data-stat="participants_men" align="right"  class="" &gt;Men&lt;/th&gt;
    &lt;th data-stat="participants_women" align="right"  class="" &gt;Women&lt;/th&gt;
    &lt;th data-stat="sports" align="right"  class="" &gt;Sports&lt;/th&gt;
    &lt;th data-stat="events" align="right"  class="" &gt;Events&lt;/th&gt;
  &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
  &lt;tr  class=""&gt;
     &lt;td align="right" &gt;&lt;a href="/olympics/summer/2012/"&gt;2012&lt;/a&gt;&lt;/td&gt;
     &lt;td align="left"  csk="London:2012"&gt;London&lt;/td&gt;
     &lt;td align="left"  csk="Great Britain:2012"&gt;Great Britain&lt;/td&gt;
     &lt;td align="right" &gt;205&lt;/td&gt;
     &lt;td align="right" &gt;10,519&lt;/td&gt;
     &lt;td align="right" &gt;5,864&lt;/td&gt;
     &lt;td align="right" &gt;4,655&lt;/td&gt;
     &lt;td align="right" &gt;32&lt;/td&gt;
     &lt;td align="right" &gt;302&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>To extract the text I used this code written in PHP 7:</p>
  
  <pre><code>&lt;?php
  
  $html = file_get_contents('http://www.sports-reference.com/olympics/summer/');
  
  error_reporting(E_ERROR | E_PARSE);
  
  $doc = new DOMDocument();
  $doc-&gt;loadHTML($html);
  
  $xpath = new DOMXpath($doc);
  $result = $xpath-&gt;query('//div[@id="div_Summer"]');
  
  
  var_dump($result-&gt;item(0)-&gt;nodeValue);
  
  ?&gt;
  </code></pre>
  
  <p>In this way I get this result:</p>
  
  <pre><code>string(2148) "
  Year
    City
    Country
    Countries
    Participants
    Men
    Women
    Sports
    Events
  2012
     London
     Great Britain
     205
     10,519
     5,864
     4,655
     32
     302
  
  "
  </code></pre>
  
  <p>I would like only this text: "2012" and "London". How could I extract this information from $result?</p>