导出到存储在数据库中的列表

试图导出产品date到Excel。 产品描述存储在带有<ul><li>标签的db中。

这里是出口到Excel的代码

 <?php //fetch query $header .= "Product Code \t"; $header .= "Product Name \t"; $header .= "Description \t"; $header .= "Purchase Cost \t"; $header .= "Selling Cost \t"; $header .= "Type \t"; while($rowtt = mysqli_fetch_array($queryrr)) { $line = ''; $code = $rowtt['code']; $name = $rowtt['Pname']; $descr = strip_tags($rowtt['description']); $pcost= $rowtt['pcost']; $scost = $rowtt['scost']; $type= $rowtt['type']; $line .= $code."\t"; $line .= $name."\t"; $line .= $descr."\t"; $line .= $pcost."\t"; $line .= $scost."\t"; $line .= $type."\t"; $data .= trim( $line ) . "\n"; $data = str_replace( "\r" , "" , $data ); } if ( $data == "" ) { $data = "\nNo Record(s) Found!\n"; } header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=Products.xls"); header("Pragma: no-cache"); header("Expires: 0"); print "$header\n ".$data.""; 

导出到excel,但在描述中,它有这样的标签<ul> <li>Lorel ipsum 123 </li> <li>Lorel ipsum 123 </li> <li>Lorel ipsum 123 </li> <li>Lorel ipsum 123 </li> </ul>

但它是这样显示的

Product Code | Product Name | Description | Purchase Cost | Selling Cost |Type PT001 | ABCD | Lorel ipsum 123
Lorel ipsum 123 Lorel ipsum 123 Lorel ipsum 123
1500 | 1800 | Type1