这些是什么ASCII字符? [英] what ASCII characters are these?

查看:69
本文介绍了这些是什么ASCII字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个字符需要搜索并替换为php字符串.

I have two characters that I need to do a search and replace on in a php-string.

  1. "

这些与以下内容有所不同:

Somehow these are different from:

  1. '
  2. "
  1. '
  2. "

有人知道我可以使用什么功能从php字符串中删除这些内容吗?

Does anyone know what function I might use to strip these from a php string?

推荐答案

当有人在Outlook中向您发送电子邮件时,会发生这种情况,因此请当心,因为您完全错过了那些单引号的开头和结尾双引号. 但实际上,您需要使用html实体代码.

That's what happens when someone sends you an email in outlook, so watch out, because you're totally missing the opening pair of those single quotes, and closing pair for the double quotes. But really, you need to be using html entity codes.

为什么?实际上,由于在野外还有比您上面发布的这两个代码更多的地狱,实际上,您只显示了引号的一半(即,您错过了右引号和双引号) .有数百种,您需要以比字符串替换更好的方式对它们进行编码.

Why? Because there's a hell of a lot more out there in the wilderness than those two codes you posted above, in-fact, you've only shown half the set of quotes (ie, you missed the closing single quote, and opening double quote). There's hundreds, you need to be encoding them in a better way than string replace.

有几种方法可以管理从编码到html实体的翻译.

There's a couple ways to manage the translation from encoding to html entity.

http://php.net/manual/en/function.htmlentities.php

http://piology.org/entities.html

http://konieczny.be/unicode.html

还有更多,但是他们基本上是做同样的事情.

There's more also, but they basically do the same thing.

这篇关于这些是什么ASCII字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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