首页 > php代码 > php 字符截取与图片过滤函数

php 字符截取与图片过滤函数

php 字符截取与图片过滤函数

本文章免费为各位朋友提供一款哦,如果你喜欢的话不防进来看看这款图片过滤正则表达试

function msubstr($str, $start, $len) {
 $tmpstr = "";
 $strlen = $start + $len;
 for($i = 0; $i < $strlen; $i++) {
       if(ord(substr($str, $i, 1)) > 0xa0) {
         $tmpstr .= substr($str, $i, 2);
         $i++;
       } else
         $tmpstr .= substr($str, $i, 1);
  }
 return $tmpstr;
 }
 
 //过滤图片
 function img_empty($content){
  $content=eregi_replace("<IMG ([a-zA-Z0-9~!& ?:"/._#=~&%]+)>","",$content);
  return $content;
 }

本文地址:http://www.phprm.com/code/28cdbb7f43c7afb9f0e61dc048a3e25e.html

转载随意,但请附上文章地址:-)

标签:none

发表留言