diff --git a/README.md b/README.md index ef4e4a3..694085c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# SimpleXLSXGen class 0.9.19 (Official) +# SimpleXLSXGen class 0.9.20 (Official) [](https://www.patreon.com/shuchkin) [](https://github.com/shuchkin/simplexlsxgen/blob/master/license.md) [](https://github.com/shuchkin/simplexlsxgen/stargazers) [](https://github.com/shuchkin/simplexlsxgen/network) [](https://github.com/shuchkin/simplexlsxgen/issues) Export data to Excel XLSX file. PHP XLSX generator. No external tools and libraries.
@@ -42,8 +42,9 @@ $data = [ ['Procent', '12%'], ['Datetime', '2020-05-20 02:38:00'], ['Date','2020-05-20'], - ['Time','02:38:00'], - ['String', 'See SimpleXLSXGen column autosize feature'] + ['Time','02:38:00'], + ['String', 'See SimpleXLSXGen column autosize feature'], + ['Disable Type Detection', "\0".'2020-10-04 16:02:00'] ]; SimpleXLSXGen::fromArray( $data )->saveAs('datatypes.xlsx'); ``` @@ -62,6 +63,7 @@ SimpleXLSXGen::fromArray( $data )->saveAs('debug.xlsx'); ## History +V0.9.20 (2020-10-04) Disable type detection if string started \0 v0.9.19 (2020-08-23) Numbers like SKU right aligned now
v0.9.18 (2020-08-22) Fixed fast shared strings index
v0.9.17 (2020-08-21) Fixed real numbers in 123.45 format detection, fast shared strings index (thx fredriksundin)
diff --git a/src/SimpleXLSXGen.php b/src/SimpleXLSXGen.php index 81ba49c..3702cc1 100644 --- a/src/SimpleXLSXGen.php +++ b/src/SimpleXLSXGen.php @@ -221,6 +221,7 @@ class SimpleXLSXGen { if ( preg_match('/^[0-9+-.]+$/', $v ) ) { // Long ? $cs = 7; // Align Right } + $v = ltrim($v,"\0"); // disabled type detection $ct = 's'; // shared string $v = str_replace(['&','<','>'],['&','<','>'], $v); $cv = false;