title: xpaths - retrieve text inside attribute and split / preg_replace?
body: <p>I have something that looks like this:</p>
  
  <pre><code>&lt;strong class="citizen_level" title="&lt;strong&gt;Experience Level&lt;/strong&gt;&lt;br/&gt;1,137,935 / 1,140,000"&gt;252&lt;/strong&gt;
  </code></pre>
  
  <p>I managed to extract 252 using : </p>
  
  <pre><code>//div[@id='content']/div[@class='citizen_profile_header']/h2/strong
  </code></pre>
  
  <p>But I also want to extract 1,137,935, but they have put that inside a title attribute, which I should be able to extract by using</p>
  
  <pre><code>//div[@id='content']/div[@class='citizen_profile_header']/h2/strong/@title
  </code></pre>
  
  <p>Which should output </p>
  
  <pre><code>&lt;strong&gt;Experience Level&lt;/strong&gt;&lt;br/&gt;1,137,935 / 1,140,000
  </code></pre>
  
  <p>Is there any reason the above code wouldnt work ?
  And can someone help me here, and get this down to 1137935 ? What would be the best way ?</p>
  
  <p><strong>Edit:</strong></p>
  
  <pre><code>$string = "&lt;strong&gt;Experience Level&lt;/strong&gt;&lt;br/&gt;1,137,935 / 1,140,000";
  
  $tmp = preg_replace('/[^0-9\/]/',"",$string);
  $tmp = ltrim($tmp, '//');
  $tmp = preg_split("/[\/,]+/", $tmp);
  
  $string = reset($string);
  </code></pre>
  
  <p>Maybe not the best way, but it seems to work ? But for some reason</p>
  
  <pre><code>//div[@id='content']/div[@class='citizen_profile_header']/h2/strong/@title
  </code></pre>
  
  <p>doesn't seem to work =/</p>