PHP过滤数组中html标签

public function cutstr_html( d a t a , data, data,encoding = ‘utf-8’){
if (is_array(KaTeX parse error: Expected '}', got 'EOF' at end of input: … foreach(data as $k => $val) {
preg_match_all("/>([^><].?)<//", v a l [ ′ d e s c ′ ] , val[&#x27;desc&#x27;], val[desc],tmp);
preg_match_all("/>([^><].
?)<//", v a l [ ′ d e s c 1 ′ ] , val[&#x27;desc_1&#x27;], val[desc1],tmp);
$tmp = t m p [ 1 ] ; f o r e a c h ( tmp[1]; foreach ( tmp[1];foreach(tmp as $k2 => $val2) {
v a l 2 = t r i m ( val2 = trim( val2=trim(val2);
KaTeX parse error: Expected 'EOF', got '\t' at position 25: …_ereg_replace("\̲t̲","",val2);
KaTeX parse error: Can't use function '\r' in math mode at position 25: …_ereg_replace("\̲r̲\n","",val2);
KaTeX parse error: Can't use function '\r' in math mode at position 25: …_ereg_replace("\̲r̲","",val2);
KaTeX parse error: Expected 'EOF', got '\n' at position 25: …_ereg_replace("\̲n̲","",val2);
v a l 2 = m b e r e g r e p l a c e ( &quot; &quot; , &quot; &quot; , val2 = mb_ereg_replace(&quot; &quot;,&quot;&quot;, val2=mberegreplace("","",val2);
if(mb_strlen(trim($val2),‘utf-8’)){
t m p [ tmp[ tmp[k2] = trim($val2);
}else{
t m p [ tmp[ tmp[k2] = mb_strcut(trim( v a l 2 ) , 0 , val2),0, val2),0,encoding);
}
}
d a t a [ data[ data[k][‘desc’] = implode(’, ‘, $tmp);
d a t a [ data[ data[k][‘desc_1’] = implode(’, ‘, $tmp);
}
$res = KaTeX parse error: Expected 'EOF', got '}' at position 11: data; }̲ else if (is_st…data)) {
preg_match_all("/>([^><].*?)<//", $data, $res);
$res = r e s [ 1 ] ; f o r e a c h ( res[1]; foreach ( res[1];foreach(res as $k => $val) {
v a l = t r i m ( val = trim( val=trim(val);
KaTeX parse error: Expected 'EOF', got '\t' at position 24: …_ereg_replace("\̲t̲","",val);
KaTeX parse error: Can't use function '\r' in math mode at position 24: …_ereg_replace("\̲r̲\n","",val);
KaTeX parse error: Can't use function '\r' in math mode at position 24: …_ereg_replace("\̲r̲","",val);
KaTeX parse error: Expected 'EOF', got '\n' at position 24: …_ereg_replace("\̲n̲","",val);
v a l = m b e r e g r e p l a c e ( &quot; &quot; , &quot; &quot; , val = mb_ereg_replace(&quot; &quot;,&quot;&quot;, val=mberegreplace("","",val);
if(mb_strlen(trim($val),‘utf-8’)){
v a l = t r i m ( val = trim( val=trim(val);
}else{
v a l = m b s t r c u t ( t r i m ( val = mb_strcut(trim( val=mbstrcut(trim(val),0,$encoding);
}
r e s [ res[ res[k] = $val;
}
$res = implode(’, ', $res);
}
return $res;
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值