Tuesday 3 April 2012

PHP Remove Incorrect encoding characters, TAB, Enter, HTML...


function dataCleasing($data){
$data = strip_tags ($data); // remove HTML Tags
   // remove Incorrect encoding characters
$data = preg_replace ( '/[^(\x20-\x7F)]*/', "", $data ); 
$data = str_replace ( "\n", "", $data );//remove Enter
$data = str_replace ( ",", "", $data );//remove Comma
$data = str_replace ( "\t", "", $data );//remove TAB
$data = str_replace ( "\r\n", "", $data );//remove Enter
$data = trim($data);
return $data;
}


帮自己宣传一下刚上线的网站 梦奇网;目前的提供的服务是 签证搜索 和 时间和日期。谢谢大家支持,SEO下!

1 comment:

  1. thanks, the very nice blog help the programming tricks good information

    ReplyDelete