Quantcast
Channel: PHPExcel Forum Rss Feed
Viewing all articles
Browse latest Browse all 2707

New Post: Newlines in Data Create Strange Repeating Values

$
0
0

I've got some data from form entries with newline characters.  Say something like "hello\nbye". If I put the value in cells like this:

$sheet->setCellValueByColumnAndRow($col, $row, $val);

I get a seemingly random repeating set of that value in the cell like:

hello
bye
hello
bye
hello
bye 

But if I do something like this to get ride of the newlines:

$sheet->setCellValueByColumnAndRow($col, $row, preg_replace("/[\r\n\f]+/", '', $val));

I just get the value once.

I'm using the Excel2007 version.  Anybody have any ideas why this would be, or seen anything similar?  I can replicate consistently with my data, happens every time.  I've tried everything I can think of, but if there's a newline character in there, this oddity happens.


Viewing all articles
Browse latest Browse all 2707

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>