如何将Windows-1252字符转换为php中的值? [英] How to convert Windows-1252 characters to values in php?

查看:70
本文介绍了如何将Windows-1252字符转换为php中的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有几个包含Windows-1252字符的数据库字段:

We have several database fields that contain Windows-1252 characters:

an example painâ€" if you’re

这些值映射到此列表中的所需值:

Those values map to the desired values from this list:

http://www.i18nqa.com/debug/utf8-debug.html

我已经尝试了htmlentite,mb_detect_encoding,uft8_decode等的各种排列,但尚未能够将这些值转换为:

I've tried various permutations of htmlentites, mb_detect_encoding, uft8_decode, etc, but have not yet been able to transform those values to:

痛苦的例子—如果你是

an example pain — if you're

如何在php中将这些字符转换为列出的值?

How can I transform these characters to their listed values in php?

推荐答案

您可以使用


演示:
http://ideone.com/NsIb5x


DEMO:
http://ideone.com/NsIb5x

这篇关于如何将Windows-1252字符转换为php中的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆