doufan9395 2015-07-02 10:02
浏览 56
已采纳

页脚中的FPDF编码

I have a problem using FPDF while using special character like é, è or à.

I used $é = iconv('UTF-8', 'windows-1252', 'é'); and then I use it like this $pdf->Cell(0,0,'Donn'.$é.'es',0,1);. I know this is not the best way to work with but that's not a big deal...

The real problem is that we can not use variable in header or footer. Or I have to write a sentence in the footer with special character. How can I proceed to this ?

  • 写回答

1条回答 默认 最新

  • duanfei9278 2015-07-02 12:17
    关注

    I had to use a global variable.

    In the main code

    global $à ;
    $à = iconv('UTF-8', 'windows-1252', 'à');
    

    In the header/footer

    $à  = $GLOBALS['à'];
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?