Maison >développement back-end >tutoriel php >php导出非乱码非乱序 奇葩有关问题求大神挫进来帮帮小弟
php导出非乱码非乱序 奇葩问题求大神挫进来帮帮小弟
上面第一个图是导出后的效果图,第二张是数据库实际数据,细心的哥们就发现导出的图后三位全部变为0,这神马情况啊
求大神指点
代码如下:
<br /> <?php<br />define('NOROBOT', true);<br />define('CURSCRIPT', 'charge');<br />require_once './include/common.inc.php';<br /><br /><br />header("Content-type:application/vnd.ms-excel;charset=utf-8");<br />header("Content-Disposition:attachment;filename=充值卡.xls");<br />$page = $page ?: 1; <br />$results = array(); <br />$condition = '';<br /> <br /> echo "被充值手机号"."\t"; <br /> echo "充值卡序列号"."\t"; <br /> echo "充值金额"."\t"; <br /> echo "实充额度"."\t"; <br /> echo "充值时间"."\t";<br /><br />$query = $mysqli->multi_query('CALL UP_User_GetCardInfo("'.$condition.'","'.$page.'","900000")') or die($mysqli->error);<br /><br />$query = $mysqli->store_result(); <br />while ($record = mysqli_fetch_array($query, MYSQLI_BOTH)){<br /><br /> $phone = $record['phone'];<br /> $cardid = $record['cardid']; <br /> $charge = $record['charge']; <br /> $achieve = $record['achieve']; <br /> $chgdate = $record['useDate']; <br /> <br /> <br /> echo "\n"; <br /> echo $phone."\t";<br /> echo $cardid."\t"; <br /> echo $charge."\t"; <br /> echo $achieve."\t"; <br /> echo $chgdate."\t"; <br /> <br /> <br />}<br />if(is_object($query)) $query->free_result();<br />$mysqli->next_result();<br /><br /><br /> <br /> <br /><br />?><br />