yourilima / php-excel-reader

Automatically exported from code.google.com/p/php-excel-reader
0 stars 0 forks source link

Date format, cells with 0 and a question #23

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,
first of all many thank for yr good library. I'm sure that will have a 
great future. Have two small problems and a question :
- have an excel file where the format of the dates is mmmm yyyy (May 2009) 
but the array created by the function shows May/2009 (space is replaced by 
the /) See attached file cells C8:C128
- the dump function doesn't display cella where the value is 0 even if the 
array is created correctly (see cell B8). This is not a big issue because 
problem seems limited to the dump function

The question is : is it possible to show/know that a cell contains a 
formula (and maybe retrieve the original formula) ? See cell G9

Tks, regards

Original issue reported on code.google.com by vve...@hotmail.it on 15 May 2009 at 1:11

Attachments:

GoogleCodeExporter commented 9 years ago
If you change line 633 of version 2.21 from:

if ($val=='') { $val=" "; }

to:

if ($val==='') { $val=" "; }

the strict comparison will only match an empty string(''). If you change it to:

if ($val==='' && !$val===0) { $val=" "; }

then it should match '', FALSE and NULL but not 0. I believe the second option 
is
more robust. You can decide for yourself by looking at php's comparison tables 
at
http://php.net/manual/en/types.comparisons.php

I don't have answers for your other issues though.

Original comment by RoamingA...@gmail.com on 4 Oct 2009 at 12:36

GoogleCodeExporter commented 9 years ago
Patch for the zero issue.

Original comment by d...@cimpress.com on 6 Jul 2010 at 7:09

Attachments: