PHP Export in Excel, if there is a row in the database column of the line, then the corresponding in Excel to change the number of lines, how to solve?
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 "," another line of newline and then line "), echo" t \ 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 "," another line of newline and then line "), echo" t \ n "," foreach "($ar as $k = + $v) { echo "$k \t\" $v \ "\ n";}
Is it used to count down from the database or not? Are your codes double-quoted?
Test example
Header ("Accept-ranges:bytes"); Header ("Content-type:application/vnd.ms-excel"); Header ("Content-disposition: Attachment Filename= ". @ $filename); $ar = Array ( " abcd123 "," another line of newline and then line "), echo" t \ n "," foreach "($ar as $k = + $v) { echo "$k \t\" $v \ "\ n";}
Sorry, just entered the wrong character, you are very useful, thank you.