note 63329 added to function.str-replace

From: Date: Mon, 20 Mar 2006 12:19:46 +0000
Subject: note 63329 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-106100@lists.php.net to get a copy of this message
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 ---- Server IP: 212.93.155.36 Probable Submitter: 213.164.225.85 ---- X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.str-replace.php Edit -- http://master.php.net/note/edit/63329 Del: integrated -- http://master.php.net/note/delete/63329/integrated Del: useless -- http://master.php.net/note/delete/63329/useless Del: bad code -- http://master.php.net/note/delete/63329/bad+code Del: spam -- http://master.php.net/note/delete/63329/spam Del: non-english -- http://master.php.net/note/delete/63329/non-english Del: in docs -- http://master.php.net/note/delete/63329/in+docs Del: other reasons-- http://master.php.net/note/delete/63329 Reject -- http://master.php.net/note/reject/63329 Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#106100) next »