Working with Excel csv retrieved data (using fgetcsv) and unknown characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is run on an XP box with WAMP install:

I have a script that downloads a Excel CSV file and then uses fgetscv to
retrieve lines, the strange thing is that in Firefox I get symbols (black
triangle with question mark in it) and in IE its basically spaces. So if I
echo these values (or print_r array result, my text string has spaces), Ive
tried opening it in Notepad etc to see what characters or codes these spaces
are, but it shows nothing. Ive opened it in PSPad and its shows only as
unknown characters (square blocks).

Im suspecting it might be tabs ?

Is there a way to remove any "unknown" characters from a line retrieved with
fgetsv ?


the getscv line used:

$handle = fopen($local_file, "r");
    while(($data = @fgetcsv($handle,1000,",")) !== FALSE)
    {

if I print out (print_r) this $data I get something like :

_�2�0�0�8�0�4�0�3� �1�4�2�0�5�1�0�0�Array
(
    [0] => ÿþE�v�e�n�t�:� �A�B�C�-�0�0�0�1�8�

    [1] => �2�
    [2] => �3�



There should be no question mark symbols but should rather look like:

_20080403 14205100Array
(
    [0] => ÿþEvent: ACC-10018
    [1] => 2

    [2] => 3

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux