将分数转换为html实体 [英] Converting fractions to html entities

查看:94
本文介绍了将分数转换为html实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经在数据库中存储了一些分数信息,例如¾½

We've got some fraction information stored in the database, e.g. ¾ ½

搜索和替换操作很短,是否有任何内置的PHP函数可以将这些函数自动转换为适当的html实体?

Short of doing a search and replace, are there any inbuilt PHP functions that will automatically convert these to proper html entities?

推荐答案

您可以使用 htmlentities()函数.这会将所有特殊字符替换为其等效的HTML.它应该可以满足您的要求.

You can use the htmlentities() function. This will replace all special characters with their HTML equivalent. It should do the job your require.

问好了,+ 1.

这篇关于将分数转换为html实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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