Cara Menghilangkan Unwanted Chars dan Angka Menggunakan PHP

2011-12-30 12.58.33 (1)
Holiday at Karimun Jawa, Indonesia
January 4, 2012
Cara Untuk Menghilangkan Tag Tertentu Menggunakan PHP
January 12, 2012

Cara Menghilangkan Unwanted Chars dan Angka Menggunakan PHP

Langsung aja nih, karna ini merupakan arsip pribadi biar ga lupa tentang Cara Menghilangkan Unwanted Chars .. hehe

<? 
function gabutuh($string){
$string= $string;
$string= preg_replace('/&.+?;/', ' ', $string);
$string= preg_replace('/\s+/', ' ', $string);
$string= preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', ' ', $string);
$string= preg_replace('|-+|', ' ', $string);
$string= preg_replace('/&#?[a-z0-9]+;/i',' ',$string);
$string= preg_replace('/[^%A-Za-z0-9 _-]/', ' ', $string);
$string= preg_replace('/[0-9]/', '', $string);
$string= str_replace('_', ' ', $string);
$string= trim($string,' ');
$string = preg_replace('/\s{2,}/',' ', $string);
return $string;
}
?>

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.