Using PHP 5.3 fgetcsv
function, I am experiencing some problems due to encoding matters. Note that that file has spanish \"special\" latin characters like graph
This is likely to do with the way excel encodes the file when saving.
Try uploading the .xls file to google docs and downloading as a .csv
Try this:
function convert( $str ) {
return iconv( "Windows-1252", "UTF-8", $str );
}
public function getRow()
{
if (($row = fgetcsv($this->_handle, 10000, $this->_delimiter)) !== false) {
$row = array_map( "convert", $row );
$this->_line++;
return $this->_headers ? array_combine($this->_headers, $row) : $row;
} else {
return false;
}
}