(1) htmlspecialchars()

表单验证(验证表单中的数据是否为空以及提交的数据是否合法)

htmlspecialchars() //该函数将预定义的字符转化为html实体,预定义的字符有:

&                                         &

"                                          "

'                                          '

<                                         &lt;

>                                         &gt;

echo 的可被浏览器解析,实体化之后在浏览器中不会被解析

(2) trim() 

去除字符串两边的空格,换行

PHP中一些常用的安全类函数的更多相关文章

  1. python 中一些常用的内置函数

    一.常用内置函数 abs(x) 返回绝对值,参数为int float,非字符只能num all(iterable) 如果迭代对象里面的所有值都为真就返回True.all([1, 2, -7]) --- ...

  2. Lua中的常用语句结构以及函数

     1.Lua中的常用语句结构介绍 --if 语句结构,如下实例: gTable = {} ] ] then ]) == gTable[] then ]) else print("unkown ...

  3. random模块中最常用的几个函数

    转自:http://www.cnblogs.com/yd1227/archive/2011/03/18/1988015.html 随机整数:>>> import random> ...

  4. php中常用的字符串查找函数strstr()、strpos()实例解释

    string strstr ( string $haystack , mixed $needle [, bool $before_needle = false ] ) 1.$haystack被查找的字 ...

  5. EL表达式 JSTL中的常用EL函数 动态数据的国际化

    ELppt: EL 全名为Expression Language.EL主要作用: 获取数据: •EL表达式主要用于替换JSP页面中的脚本表达式,以从各种类型的web域 中检索java对象.获取数据.( ...

  6. Mysql中的常用函数:

    Mysql中的常用函数: 1.字符串函数: (1).合并字符串 concat():// concat('M','y',"SQL",'5.5');== MySQL5.5//当传入的参 ...

  7. socket编程中客户端常用函数

    1 常用函数 1.1   connect() int connect(int sockfd, const struct sockaddr *servaddr, socklen_taddrlen); 客 ...

  8. 日期时间函数 mysql 和sqlserver 中对于常用函数的日期和时间函数的区别

    1. sqlserver中获取时间用getdate(),默认返回格式是2019-01-21 13:58:33.053,具体的年月日,时分秒毫米,年月日之间用短线连接,时分秒之间用冒号连接,秒和毫米之间 ...

  9. LoadRunner中常用的字符串操作函数

    LoadRunner中常用的字符串操作函数有:                strcpy(destination_string, source_string);               strc ...

随机推荐

  1. Bing壁纸-20200416

  2. oranges-给mini os 添加内存管理,进程多级反馈队列,进程内存完整性度量

    参考: 内存管理: https://www.jianshu.com/p/49cbaccd38c5 crc校验 https://www.cnblogs.com/zzdbullet/p/9580502.h ...

  3. leetcode 39 dfs leetcode 40 dfs

    leetcode 39 先排序,然后dfs 注意先整全局变量可以减少空间利用 class Solution { vector<vector<int>>ret; vector&l ...

  4. HDU - 4455 Substrings(非原创)

    XXX has an array of length n. XXX wants to know that, for a given w, what is the sum of the distinct ...

  5. 计算机网络 part1 TCP

    一.TCP协议 references:newcoder TCP/IP协议,TCP和UDP的区别及特点 1.四层模型 应用层:载有应用程序,将数据发送给传输层.主要协议有HTTP.SMTP.FTP.DN ...

  6. 事件循环 EventLoop(Promise,setTimeOut,async/await执行顺序)

    什么是事件循环?想要了解什么是事件循环就要从js的工作原理开始说起: JS主要的特点就是单线程,所谓单线程就是进程中只有一个线程在运行. 为什么JS是单线程的而不是多线程的呢? JS的主要用途就是与用 ...

  7. Web API 设计

    Web API 设计 The Design of Web APIs free online ebook https://www.manning.com/books/the-design-of-web- ...

  8. web components & publish custom element & npm

    web components & publish custom element & npm https://www.webcomponents.org/publish Polymer ...

  9. github & personal access token

    github & personal access token OAuth https://github.com/xgqfrms/webtrc-in-action/issues/1#issuec ...

  10. javascript disable scroll event

    javascript disable scroll event Document: scroll event https://developer.mozilla.org/en-US/docs/Web/ ...