function
G_htmlcut(
$s
,
$zi
,
$ne
=',br,hr,input,img,'){
$s
=preg_replace('/\s{2,}/',' ',
$s
);
$os
=preg_split('
preg_match_all('
$s
='';
$tag
=
array
();
foreach
(
$os
as
$k
=>
$v
){
if
(
$v
!='' &&
$v
!=' '){
$l
=
strlen
(
$v
);
for
(
$i
=0;
$i
127){
$s
.=
$v
[
$i
].
$v
[++
$i
].
$v
[++
$i
];
}
else
{
$s
.=
$v
[
$i
];
}
$zi
--;
if
(
$zi
< 1){
break
2;
}
}
}
preg_match('/]+)[\s>]{1}/',
$or
[0][
$k
],
$t
);
$s
.=
$or
[0][
$k
];
if
(
strpos
(
$ne
,','.
strtolower
(
$t
[1]).',')===false &&
$t
[1]!='' &&
$t
[1]!=' '){
$k
=
array_search
('',
$tag
);
if
(
$k
!==false){
unset(
$tag
[
$k
]);
}
else
{
array_unshift
(
$tag
,'');
}
}
}
return
$s
.implode('',
$tag
);
}