note 63329 deleted from function.str-replace by nlopess

From: Date: Mon, 20 Mar 2006 22:00:52 +0000
Subject: note 63329 deleted from function.str-replace by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-106123@lists.php.net to get a copy of this message
Note Submitter: dj50 ---- A function to replace Romanian characters to their English corespondents: <?php function diacritice($x) { $dfrom=array( "\x26\x23\x32\x35\x39\x3b", "\x26\x23\x32\x35\x38\x3b", "\xe2", "\xc2", "\x26\x23\x33\x35\x31\x3b", "\x26\x23\x33\x35\x30\x3b", "\x26\x23\x33\x35\x35\x3b", "\x26\x23\x33\x35\x34\x3b", "\xee", "\xce" ); $dto=array( "a", "A", "a", "A", "s", "S", "t", "T", 'i', 'I' ); return (str_replace($dfrom,$dto,$x)); } echo diacritice('ăĂâÂţŢşŞîÎ'); ?> Displays: aAaAtTsSiI

« previous php.notes (#106123) next »