PHP,Excel导出换行

422101-20190709115912784-1239224222.png

// 有id,才算真的有发票数据
if ($v['b_invoice_id']) {
    $v['b_invoice_info'] = json_decode($v['b_invoice_json'],true);
    $v['b_invoice_str'] .= '类型:';
    if ((int)$v['b_invoice_purchase'] === 1) { $v['b_invoice_str'] .='(收购)'; }
    if ((int)$v['b_invoice_info']['type'] === 1) { $v['b_invoice_str'] .='普通发票'; } else { $v['b_invoice_str'] .= '专用发票'; }
    $v['b_invoice_str'] .= "\r\n公司名称/姓名:";
    $v['b_invoice_str'] .= $v['b_invoice_info']['company_name'];
    $v['b_invoice_str'] .= "\r\n识别号/身份证:";
    $v['b_invoice_str'] .= $v['b_invoice_info']['company_tax'];
    $v['b_invoice_str'] .= "\r\n电话:";
    $v['b_invoice_str'] .= $v['b_invoice_info']['company_telephone']?:'无';
    $v['b_invoice_str'] .= "\r\n地址:";
    $v['b_invoice_str'] .= $v['b_invoice_info']['company_address']?:'无';
    $v['b_invoice_str'] .= "\r\n开户行:";
    $v['b_invoice_str'] .= $v['b_invoice_info']['company_bank']?:'无';
    $v['b_invoice_str'] .= "\r\n开户账号:";
    $v['b_invoice_str'] .= $v['b_invoice_info']['company_account']?:'无';
} else {
    $v['b_invoice_info'] = [];
}
if ($v['c_invoice_id']) {
    $v['c_invoice_info'] = json_decode($v['c_invoice_json'],true);
    $v['c_invoice_str'] .= '类型:';
    if ((int)$v['c_invoice_info']['type'] === 1) { $v['c_invoice_str'] .='普通发票'; } else { $v['c_invoice_str'] .= '专用发票'; }
    $v['c_invoice_str'] .= "\r\n公司名称:";
    $v['c_invoice_str'] .= $v['c_invoice_info']['company_name'];
    $v['c_invoice_str'] .= "\r\n识别号:";
    $v['c_invoice_str'] .= $v['c_invoice_info']['company_tax'];
    $v['c_invoice_str'] .= "\r\n电话:";
    $v['c_invoice_str'] .= $v['c_invoice_info']['company_telephone']?:'无';
    $v['c_invoice_str'] .= "\r\n地址:";
    $v['c_invoice_str'] .= $v['c_invoice_info']['company_address']?:'无';
    $v['c_invoice_str'] .= "\r\n开户行:";
    $v['c_invoice_str'] .= $v['c_invoice_info']['company_bank']?:'无';
    $v['c_invoice_str'] .= "\r\n开户账号:";
    $v['c_invoice_str'] .= $v['c_invoice_info']['company_account']?:'无';
}

\r\n
必须是双引号。

转载于:https://www.cnblogs.com/jiqing9006/p/11156448.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值