|
[تحسين] حذف الرموز غير المرغوب فيها من اكواد html
هذه الدالة تحذف اى رمز من هذه الرموز html special code chars التى تم معالجتها بواسطة strip_tags
function remEntities($str) {
if(substr_count($str, '&') && substr_count($str, ';')) {
// Find amper
$amp_pos = strpos($str, '&');
//Find the ;
$semi_pos = strpos($str, ';');
// Only if the ; is after the &
if($semi_pos > $amp_pos) {
//is a HTML entity, try to remove
$tmp = substr($str, 0, $amp_pos);
$tmp = $tmp. substr($str, $semi_pos + 1, strlen($str));
$str = $tmp;
//Has another entity in it?
if(substr_count($str, '&') && substr_count($str, ';'))
$str = remEntities($tmp);
}
}
return $str;
}
|
الموقع الآن فى الفترة التجريبية وهذا الجزء غير كامل وجارى العمل عليه، للراغبين في المساعدة برجاء التقدم

