title: php: SimpleXML Load File Invalid Character Error
body: <p>I have a php application which -sometimes- fails (depends on what data I load) and gives errors like:</p>
  
  <pre><code>parser error : PCDATA invalid Char value 11
  Warning: simplexml_load_file(): ath&gt;/datadrivenbestpractices/Data-driven Best Practices in 
  Warning: simplexml_load_file(): ^ in 
  </code></pre>
  
  <p>I am certain that there are some values which are causing the problem. I don't have control over data. I have tried solutions from: <a href="https://stackoverflow.com/questions/2507608/error-input-is-not-proper-utf-8-indicate-encoding-using-phps-simplexml-lo">Error: &quot;Input is not proper UTF-8, indicate encoding !&quot; using PHP&#39;s simplexml_load_string</a> and <a href="https://stackoverflow.com/questions/7766455/how-to-handle-invalid-unicode-with-simplexml">How to handle invalid unicode with simplexml</a> and <a href="https://stackoverflow.com/questions/3466035/how-to-skip-invalid-characters-in-xml-file-using-php">How to skip invalid characters in XML file using PHP</a> but they have not helped. </p>
  
  <p>The culprit strings are: 'Data Driven - Best Practices' and 'Data-driven Best Practices to Recruit and Retain Underrepresented Graduate Students May 12, 2011 - 1:30-3:00 p.m., EST' (may be dashes or return characters).</p>
  
  <p>What can I do? Mine is a Windows php test environment but the live environment will be a LAMP one--can 't touch the .ini files.</p>
  
  <p>Thanks.</p>