当前位置:网站首页>php 自带过滤和转义函数
php 自带过滤和转义函数
2022-07-07 14:07:00 【全栈程序员站长】
分类:
函数名 | 释义 | 介绍 |
---|---|---|
htmlspecialchars | 将与、单双引号、大于和小于号化成HTML格式 | &转成&“转成"‘ 转成'<转成<>转成> |
htmlentities() | 所有字符都转成HTML格式 | 除上面htmlspecialchars字符外,还包括双字节字符显示成编码等。 |
addslashes | 单双引号、反斜线及NULL加上反斜线转义 | 被改的字符包括单引号 (‘)、双引号(“)、反斜线 backslash (\) 以及空字符NULL。 |
stripslashes | 去掉反斜线字符 | 去掉字符串中的反斜线字符。若是连续二个反斜线,则去掉一个,留下一个。若只有一个反斜线,就直接去掉。 |
quotemeta | 加入引用符号 | 将字符串中含有 . \\ + * ? [ ^ ] ( $ )等字符的前面加入反斜线 “\” 符号。 |
nl2br() | 将换行字符转成<br> | |
strip_tags | 去掉HTML及PHP标记 | 去掉字符串中任何 HTML标记和PHP标记,包括标记封堵之间的内容。注意如果字符串HTML及PHP标签存在错误,也会返回错误。 |
mysql_real_escape_string | 转义SQL字符串中的特殊字符 | 转义 \x00 \n \r 空格 \ ‘ ” \x1a,针对多字节字符处理很有效。mysql_real_escape_string会判断字符集,mysql_escape_string则不用考虑。 |
base64_decode | base64解码 | 对使用 MIME base64 编码的数据进行解码 |
base64_encode | base64编码 | 使用 MIME base64 对数据进行编码 |
rawurldecode | URL解码 | 对已编码的 URL 字符串进行解码 |
rawurlencode | URL编码 | 按照 RFC 1738 对 URL 进行编码 |
urldecode | URL解码 | 解码已编码的 URL 字符串 |
urlencode | URL编码 | 编码 URL 字符串 |
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/113210.html原文链接:https://javaforall.cn
边栏推荐
- 保证接口数据安全的10种方案
- Xcode Revoke certificate
- Logback日志框架第三方jar包 免费获取
- Is it reliable to open an account on Tongda letter with your mobile phone? Is there any potential safety hazard in such stock speculation
- 47_Opencv中的轮廓查找 cv::findContours()
- 分类模型评价标准(performance measure)
- numpy---基础学习笔记
- A wave of open source notebooks is coming
- How to query the data of a certain day, a certain month, and a certain year in MySQL
- 2022 the 4th China (Jinan) International Smart elderly care industry exhibition, Shandong old age Expo
猜你喜欢
What about the pointer in neural network C language
torch.numel作用
Numpy -- data cleaning
Plate - forme de surveillance par étapes zabbix
Apache Doris just "graduated": why should we pay attention to this kind of SQL data warehouse?
Eye of depth (VI) -- inverse of matrix (attachment: some ideas of logistic model)
Three. JS introductory learning notes 00: coordinate system, camera (temporarily understood)
MySQL数据库基本操作-DQL-基本查询
What are compiled languages and interpreted languages?
Odoo集成Plausible埋码监控平台
随机推荐
Unity3D_ Class fishing project, control the distance between collision walls to adapt to different models
TCP framework___ Unity
A wave of open source notebooks is coming
Regular expression string
laravel 是怎么做到运行 composer dump-autoload 不清空 classmap 映射关系的呢?
融云斩获 2022 中国信创数字化办公门户卓越产品奖!
Logback日志框架第三方jar包 免费获取
hellogolang
Description of vs common shortcut keys
Numpy -- data cleaning
Learn good-looking custom scroll bars in 1 minute
A JS script can be directly put into the browser to perform operations
SysOM 案例解析:消失的内存都去哪了 !| 龙蜥技术
尤雨溪,来了!
nodejs package. JSON version number ^ and~
Is it reliable to open an account on Tongda letter with your mobile phone? Is there any potential safety hazard in such stock speculation
通知Notification使用全解析
[excelexport], Excel to Lua, JSON, XML development tool
2022 the 4th China (Jinan) International Smart elderly care industry exhibition, Shandong old age Expo
Rongyun won the 2022 China Xinchuang digital office portal excellence product award!