If a line break exists in the content of a column of the database in the excel file exported by php, it is replaced by multiple lines in the excel file. how can this problem be solved? If a line break exists in the content of a column of the database in the excel file exported by php, it is replaced by multiple lines in the excel file. how can this problem be solved?
The code is as follows:
Reply to discussion (solution)
Test example
Header ("Accept-Ranges: bytes"); header ("Content-type: application/vnd. ms-excel "); header (" Content-Disposition: attachment; filename = ". @ $ filename); $ ar = array ("abcd123", "next line feed and next line feed"); echo "no. \ t remarks \ n "; foreach ($ ar as $ k = >$ v) {echo "$ k \ t \" $ v \ "\ n ";}
Test example
Header ("Accept-Ranges: bytes"); header ("Content-type: application/vnd. ms-excel "); header (" Content-Disposition: attachment; filename = ". @ $ filename); $ ar = array ("abcd123", "next line feed and next line feed"); echo "no. \ t remarks \ n "; foreach ($ ar as $ k = >$ v) {echo "$ k \ t \" $ v \ "\ n ";}
Is it not easy to use it for reciprocal from the database? Are your code double quotes?
Test example
Header ("Accept-Ranges: bytes"); header ("Content-type: application/vnd. ms-excel "); header (" Content-Disposition: attachment; filename = ". @ $ filename); $ ar = array ("abcd123", "next line feed and next line feed"); echo "no. \ t remarks \ n "; foreach ($ ar as $ k = >$ v) {echo "$ k \ t \" $ v \ "\ n ";}
Sorry, you entered the wrong character. it is very useful. thank you.