ip2long IP地址转换成整型。 long2ip 整型数据转换成IP。 子网掩码转换成掩码长度方式: $slash_notation = strlen(preg_replace("/0/", "", decbin(ip2long($subnet_mask)))); $bits=strpos(decbin(ip2long($mas...
分类:
Web程序 时间:
2014-10-31 12:13:27
阅读次数:
300
报错提示:
Fatal error: Function name must be a string in D:\wwwroot\zbphp.com\ThinkPHP\Library\Behavior\ReadHtmlCacheBehavior.class.php on line
87
代码如下:
// {|FUN} 单独使用函数
$rule = preg_replace_...
分类:
Web程序 时间:
2014-10-22 12:55:51
阅读次数:
345
php将符号替换为空格
<?php
$character = "!@#$%^&*中'文中'文中'文().,<>|[]'\":;}{-_+=?/abcdefgh中'文ijklmnopqrstuvwx中'文yzABCDEFGHI中文JKLMNOPQRSTUVWXYZ~`中'文文文文文";
$reg = "/[[:punct:]]/i";
$character = preg_replace($reg, '', $character);
print_r($character);
die;
?>...
分类:
Web程序 时间:
2014-10-13 16:12:19
阅读次数:
191
// 驼峰字符串转换成下划线样式$str = 'openAPI';echo $str."";echo strtolower(preg_replace('/((?';//open_ap正则表达式补充:?: 不想被捕获的时候使用 可以提高程序执行速度$string = 'April 15, 2003';...
分类:
其他好文 时间:
2014-10-13 13:00:59
阅读次数:
215
$str?=?preg_replace(?"@<script(.*?)</script>@is",?"",?$str?);?
$str?=?preg_replace(?"@<iframe(.*?)</iframe>@is",?"",?$str?);?
$str?=?preg_replace(?"@<style(.*?)</style>@is",?"",?...
分类:
Web程序 时间:
2014-09-27 19:46:00
阅读次数:
164
收集了一份php正则表达式的实例教程,真心不错,记录下。正则表达式用于字符串处理、表单验证等场合,实用高效。一些常用的表达式:$str = preg_replace("/()(.*?)()/", '\1\2\3', $str);其中用了三个子模式(每个圆括号中内容为一个子模式),第一个是链接开始标签...
分类:
其他好文 时间:
2014-09-25 19:11:17
阅读次数:
365
2.7.2以前版本应该是完全可以的,但是自从2.7.2某个补丁版本之后,包括现在的 2.7.3 已经“不可以”了。如果你想自由的在 模板文件里书写 php代码,还需要修改一下/includes/cls_template.php文件将下面这行代码删除$source = preg_replace("/|...
分类:
Web程序 时间:
2014-09-22 19:58:23
阅读次数:
413
$str=preg_replace("/\s+/", " ", $str); //过滤多余回车$str=preg_replace("//si","",$str); //注释$str=preg_replace("//si","",$str); //过滤DOCTYPE$str=preg_replace(...
分类:
Web程序 时间:
2014-09-22 00:36:41
阅读次数:
273
$str=preg_replace("/\s+/", " ", $str); //过滤多余回车$str=preg_replace("//si","",$str); //注释$str=preg_replace("//si","",$str); //过滤DOCTYPE$str=preg_replace(...
分类:
Web程序 时间:
2014-09-17 11:43:22
阅读次数:
200
PHP代码$str = preg_replace("/()(.*?)()/", '\1\2\3', $str);其中用了三个子模式(每个圆括号中内容为一个子模式),第一个是链接开始标签,第二个是链接文本,第三个是然后第二个参数中\1、\2、\3就表示这三个部分,要替换成什么样子还不简单?获取页面中的...
分类:
Web程序 时间:
2014-09-17 11:38:22
阅读次数:
286