Special Characters in FPDF with PHP

前端 未结 8 1962
陌清茗
陌清茗 2020-12-05 00:16

I have a web form that users can fill out and that content fills up a PDF with FPDF and PHP. When a user enters a word with an apostrophe, a slash appears before it on the P

8条回答
  •  没有蜡笔的小新
    2020-12-05 00:35

    None of above had solved my problem. I had solved it by the following way:

    setlocale(LC_CTYPE, 'en_US');
    
    $value = iconv('UTF-8', 'ASCII//TRANSLIT', $value);
    $fpdf->Cell(140, 6, $value, 1);
    

    Hope you will be helpful.

    Reference: Link

提交回复
热议问题