I have a government client that requires the legal 'section symbol' (§) in their documents. When creating the documents in a web page, this symbol is created with §
or §
.
I can not figure out how to get either of these to work in a pdf document created with FPDF. I have tried the iconv and utf8_decode methods, but neither have worked. Any ideas?
You're looking for html_entity_decode()
.
There is an easier approach to do this:
You can generate a section symbol using FPDF with using ascii code: chr(167)
.
It's good practice to make this a constant. At the top of your script, add:
define('SECTION',chr(167));
Now you can use SECTION
in your script to print the euro symbol.
For example:
echo SECTION.'1.1';
Will output: §1.1
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With