排除HTML,URI,电子邮件或电话号码 [英] Exclude HTML, URI's, E-Mail or Telephone Numbers

查看:137
本文介绍了排除HTML,URI,电子邮件或电话号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最开始,我对PHP知之甚少,但正在使用PHP编写的网站上对功能进行设计.

任何人都可以为我指出正确的方向,以检查自由文本字段中是否包含任何HTML,URI,电子邮件地址或电话号码.

这个想法是,用户可以输入一条消息,该消息将匿名发送给另一位用户,我们需要尽可能避免阻止系统进行进一步的通信,因为我们将向他们收取联系方式.

就像我说的那样,我真的需要一些有关如何使用PHP完成此操作的帮助,以便向开发人员解释.

任何帮助将不胜感激.

Up front, I know little about PHP but am putting together a design for functionalality on a web site written in PHP.

Can anyone point me in the right direction for checking if a free text field has any HTML, URI''s, E-Mail addresses or telephone numbers in it.

The idea is that a user can enter a message that will be sent anonymously to another user and we need to prevent, as much as possible, circumventing the system for further communication as we will be charging them for contact details.

As I said, I really need some help on how this can be done using PHP so I can explain it to the developers.

Any help will be much appreciated.

推荐答案

简短答案:使用正则表达式:
http://php.net/manual/en/book.pcre.php [ ^ ].

其他所有内容都取决于您必须开发的特定规格.这里没有什么可说的建议:这与专家建议无关,而是有关大量工作和获得这些技术经验的信息.

—SA
Short answer: use Regular Expressions:
http://php.net/manual/en/book.pcre.php[^].

Everything else depends on particular specifications you have to develop. There is no much to advise here: this is not about some expert recommendations but rather about some good volume of work and getting experience with those techniques.

—SA


这篇关于排除HTML,URI,电子邮件或电话号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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