使用fpdf创建pdf时从db查询中删除/转换字符

时间:2014-04-10 16:03:21

标签: mysql character-encoding fpdf

我从mysql表中提取数据并使用fpdf创建pdf文件。我从一个名为abstr的字段中提取数据,所以我有$ abstract = $ data [' abstr']然后$ pdf-> Write(5,$ abstract)来编写它。问题是文本出现如下:

<p>Inferences and assumptions assist in information processing but also deny rather than facilitate critical thinking. Critical thinking is foundational to the development of tolerance and respectful relationships. Assignments in our course on &ldquo;hate&rdquo; have been shown to foster an inclusive world view, but students' lack of tolerance for ambiguity interferes with this progression.</p>

如何摆脱/转换

<p>, </p>,&ldquo;

和其他角色?我尝试过html_entity_decode,但它似乎没有用。

1 个答案:

答案 0 :(得分:1)

试试这个:utf8_decode($abstract)