title: unable to split a string that is parsed from a webpage?
body: <p>Here I am parsing a webpage and getting the 'name' field from that webpage. Here is the code that does the parsing:</p>
  
  <pre><code>foreach($dom-&gt;getElementsByTagName('table') as $table) {
      if($table-&gt;getAttribute('class')=='dataTable'){
          foreach($table-&gt;getElementsByTagName('tr') as $tr){
              if(isset($tr-&gt;getElementsByTagName('td')-&gt;item(0)-&gt;nodeValue)){
                  $out[$i]['name'] = $tr-&gt;getElementsByTagName('td')-&gt;item(0)-&gt;nodeValue;
              }
          }
      }
  }
  </code></pre>
  
  <p>In the webpage I am parsing I have the nodevalue for <code>name</code> in the form of 'Mark&amp;nbspSmith'. So when I get the result I have 'name' value as 'Mark Smith' in IDE and 'Mark┬áSmith' in command promt. </p>
  
  <p>Now I want to split the 'name' string in such a way so that I get firstname('Mark') and lastname('smith') separately.</p>
  
  <p>I tried:</p>
  
  <pre><code>explode("┬á", $out[$i]['name']) as well as
  explode(" " , $out[$i]['name'])
  </code></pre>
  
  <p>But nothing seems to work for me. Help me to split the string as firstname and lastname?</p>
  
  <p>Hope I am clear with my question.</p>