Problems with FPDF and Euro symbol

后端 未结 4 2040
醉酒成梦
醉酒成梦 2021-02-08 02:20

I\'ve spent a couple of days sifting through various methods to encourage FPDF to render the Euro symbol, but none have succeeded. I have:

$currency = iconv(\"UT         


        
4条回答
  •  你的背包
    2021-02-08 02:31

    You actually can generate a PDF with euro signs using FPDF with using euro ascii code: chr(128).

    It's good practice to make this a constant. At the top of your script, add:

    define('EURO',chr(128));
    

    Now you can use EURO in your script to print the euro symbol. For example:

    "Costs: ".EURO.100
    

    Will output: Costs: €100

    Note: This will also work for other symbols with chr(ascii), where ascii is the ascii code of the symbol. You can find an overview of ascii codes on this page: http://www.atwebresults.com/ascii-codes.php?type=2

提交回复
热议问题