在安装Ecshop的时候,遇到好多好多问题: 1.Strict Standards: Non-static method cls_image::gd_version() should not be called statically in D:\X\www\ecshop\install\includ ...
分类:
其他好文 时间:
2016-04-11 11:41:47
阅读次数:
189
PHP中嵌入正则表达式常用的函数有四个:1、preg_match() :preg_match() 函数用于进行正则表达式匹配,成功返回 1 ,否则返回 0 。语法:int preg_match( string pattern, string subject [, array matches ] ) ...
分类:
Web程序 时间:
2016-04-06 07:03:37
阅读次数:
177
今天安装Ecshop后,运行出现各种问题,其中 Deprecated: preg_replace() 之类的报错最多,下面贴出解决方案: 错误原因: preg_replace() 函数中用到的修饰符 /e 在 PHP5.5.x 中已经被弃用了。 如果你的PHP版本恰好是PHP5.5.X,那你的ECS
分类:
其他好文 时间:
2016-03-08 13:21:13
阅读次数:
686
php 安全过滤函数代码,防止用户恶意输入内容。 //安全过滤输入[jb] function check_str($string, $isurl = false) { $string = preg_replace('/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]/','',$
分类:
Web程序 时间:
2016-02-16 23:27:10
阅读次数:
199
XSS是一种经常出现在web应用中的计算机安全漏洞,它允许恶意web用户将代码植入到提供给其它用户使用的页面中。 比如这些代码包括HTML代码和客户端脚本。 function remove_xss($string) { $string = preg_replace('/[\x00-\x08\x0B\
分类:
其他好文 时间:
2016-02-03 10:42:49
阅读次数:
216
首先分享一些比较常见的 $str=preg_replace("/<s*imgs+[^>]*?srcs*=s*(''|")(.*?)\1[^>]*?/?s*>/i","", $str); //过滤img标签 $str=preg_replace("/s+/","", $str); //过滤多余回车 $s
分类:
Web程序 时间:
2016-01-28 13:50:30
阅读次数:
137
正则表达式: $str = "aa1bb2cc3dd4"; $reg = "/\d/i"; 定界符// i不区分大小写, 写在定界符外面 preg_replace{$reg,"#",$str}; 第一项是正则表达式,第二个是#代替,第三个是字符串 preg_split($reg,$str...
分类:
Web程序 时间:
2016-01-27 09:16:40
阅读次数:
223
1. 当用普通的方法去不了空格时,可以试试下面的方法:针对全角空格:preg_replace("/(\xc2\xa0)/",' ',$str);所有空格通用:preg_replace("/(\s|\ \;| |\xc2\xa0)/",' ',$str);2. 有时候字符串已经是UTF-8编码...
分类:
Web程序 时间:
2016-01-16 22:35:04
阅读次数:
227
// 1. 过滤字符串中src 属性为空的img 标签 $filterBack = preg_replace("/]*src\=[\'\"][\'\"][^]*>/" , "" , $str);// 。。。。
分类:
Web程序 时间:
2016-01-08 18:43:24
阅读次数:
158
strtr() str_replace() substr_replace() preg_replace()strtr()的用法: 1 '')); // es12 $str6 = strtr($str, array("e" => 'www', "s" => "hhh"));// twwwh...
分类:
Web程序 时间:
2016-01-08 18:20:38
阅读次数:
162