title: Encoding: exporting special characters from an excel spreadsheet into a php array
body: <p>I am trying to get the information from an excel spreadsheet into a PHP array.
  The problem being that the entries in the spreadsheet include special accented characters such as á and ž etc.</p>
  
  <p>The first thing I did is to export the spreadsheet as a .txt file. I made sure to click on tools --> web options, in order to set the character encoding to UTF-8.</p>
  
  <p>When I opened the .txt file with notepad or notepad++ many (but not all) of the accented characters were replaced with '?'. </p>
  
  <p>for example:
  Zlatan Ibrahimović ----> Zlatan Ibrahimovi?</p>
  
  <p>However, some of the characters remained unaffected:
  Carlos Tévez</p>
  
  <p>Furthermore, when I attempted to import the .txt file into a PHP array, the remaining characters turned into question marks aswell!</p>
  
  <p>The following code, is intended to print the first 4 names in the list:</p>
  
  <pre><code>$file = fopen("players/player_names.txt", "r") or exit("Unable to open file!");
  
  $line_array = array();
  $x = 0;
  while(!feof($file))
  {
  array_push($line_array, fgets($file));
  }
  fclose($file);
  
  $name_array = array();
  
  for ($i =1; $i &lt; 4; $i++ )
  {
  echo $line_array[$i];
  echo "&lt;br/&gt;";   
  }
  </code></pre>
  
  <p>However, the following is displayed:</p>
  
  <p>Sergio Ag�ero 
  Zlatan Ibrahimovi? 
  Carlos T�vez 
  Luis Su�rez </p>
  
  <p>It appears that the normal question marks '?' are being produced in the transfer from excel to .txt, and the black background question marks of the remaining accented characters '�' are being produced when importing the .txt file to PHP.</p>
  
  <p>I have made sure the character encoding of the PHP file is set to UTF-8 with the following:</p>
  
  <pre><code>header ('Content-type: text/html; charset=utf-8');
  </code></pre>
  
  <p>Where am I going wrong!?</p>
  
  <p>Thanks for your help in advance :).</p>