我正在抓取某些站点,并具有要转换为纯文本以存储在数据库中的ASCII文本。例如我想要
I have got to tell anyone who will listen that this is
one of THE best adventure movies I've ever seen.
It's almost impossible to convey how pumped I am
now that I've seen it.
转换成
I have got to tell anyone who will listen that this is
one of THE best adventure movies I've ever seen. It's
almost impossible to convey how pumped I am now that
I've seen it.
我用手指搜寻了血腥的手指,有什么帮助吗?
最佳答案
您可以使用 html_entity_decode
:
echo html_entity_decode('...', ENT_QUOTES, 'UTF-8');
几点注意事项:

之类的实体)转换为ASCII AKA纯文本。 更新:Example with your text in ideone。
Update2:通过@Daan的建议将ENT_COMPAT更改为ENT_QUOTES。
关于php - 在PHP中将ASCII转换为纯文本,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10595691/