The customer asked a question today that the cell line of the exported excel file does not have a line break. The solution is found by searching for resources.
The customer asked a question today that the cell line of the exported excel file does not have a line break. The solution is found by searching for resources.
The source code is opened, and the line feed method used in the string is "Name: {$ name} \ nAddress: {$ adress} \ nCity: {$ city} \ nCountry: {$ country} \ n ......"
Since "\ n" cannot start with a line break, change it to "\ r \ n.
Modify = submit = test
There is still no line feed !!!!
Is it a problem with operating system compatibility ??
Directly use the php runtime constant PHP_EOL to replace "\ r \ n"
Modify = submit = test
There is still no line feed !!!!
What is the situation? This cannot solve the problem of OS compatibility.
Let's see how the xls file is generated using php.
I read the excel Code generated. Oh My Lady gaga, it was originally in html format, but the file suffix was written as xls. Since the html format and website space should be
You can use a line feed.
Continue
Modify = submit = test
The result is a line break. Congratulations. The problem is finally solved.
Tell the boss to solve the problem. At this time, I am very happy.
After a quarter of a year, the boss ran and said, "The problem with the line feed effect is solved, but you can see that the data cannot be copied ."
....
N sentences are omitted.
Copy the data of a cell, and paste it into the word. Oh My Lady gaga, why is there border ????
What is the problem ?? Use \ n, \ r \ n to indicate that a newline cannot be entered. Use
The effect is achieved, but there are new problems... How is it good?
No. use BAIDU google.
Finally, Huang Tian lost his mind and found the answer to the question.
In