diff options
author | Ignace Nyamagana Butera <nyamsprod@gmail.com> | 2014-12-11 09:13:56 +0100 |
---|---|---|
committer | Ignace Nyamagana Butera <nyamsprod@gmail.com> | 2014-12-11 09:13:56 +0100 |
commit | ffc2e213fab7032262130140c0d57c559380f383 (patch) | |
tree | 3f88ba0026806957e1adb24ebc97d023452ec310 /examples/writing.php | |
parent | fbe42a2629bb378f4d9841df4bf3de4ca33def53 (diff) | |
download | csv-ffc2e213fab7032262130140c0d57c559380f383.zip csv-ffc2e213fab7032262130140c0d57c559380f383.tar.gz csv-ffc2e213fab7032262130140c0d57c559380f383.tar.bz2 |
improving added newline feature
Diffstat (limited to 'examples/writing.php')
-rwxr-xr-x | examples/writing.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/writing.php b/examples/writing.php index 557e74a..a625581 100755 --- a/examples/writing.php +++ b/examples/writing.php @@ -9,8 +9,9 @@ require '../vendor/autoload.php'; $writer = Writer::createFromFileObject(new SplTempFileObject()); //the CSV file will be created into a temporary File $writer->setDelimiter("\t"); //the delimiter will be the tab character -$writer->setLineEnding("\r\n"); //use windows line endings for compatibility with some csv libraries +$writer->setNewline("\r\n"); //use windows line endings for compatibility with some csv libraries $writer->setEncodingFrom("utf-8"); +$writer->setNullHandlingMode(Writer::NULL_AS_EMPTY); //if a null content cell is encountered it will be converted into a empty content $headers = ["position" , "team", "played", "goals difference", "points"]; $writer->insertOne($headers); |