skip to Main Content

Buang aksara yang bukan ASCII

Aku benci betul aksara bukan ASCII. Contohnya:�
Bongek betul. Lantas aku mencari kaedah utk membuang kod ini. Iaitu:

$output = "Clean this copy of invalid non ASCII äócharacters.";
$output = preg_replace('/[^(\x20-\x7F)]*/','', $output);
echo($output);

Sumber: http://www.stemkoski.com/php-remove-non-ascii-characters-from-a-string/

Johari Rahmad

Founder of Kapasitor, owner or Karya Media Sdn Bhd, husband of Nadia & father of Naquibs

Back To Top
×Close search
Search