This is a discussion on Transliterate characters within the PHP Language forums, part of the PHP Programming Forums category; In perl I was able to do: $var =~ y/ĘÓĄŚŁŻŹĆŃęóąś...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
"Leszek Dubiel" <leszek@dubiel.pl> wrote in message
news:72ebed91.0408201005.32b13a3d@posting.google.c om... > In perl I was able to do: > > $var =~ y/ĘÓĄŚŁŻŹĆŃęóąśł żźćń/EOASLZXCNeoaslzxcn/; > > How does this oneliner look like in php? > > Leszek Dubiel > > PS. Already searched for help...and found no answer.... The strtr() function is the PHP equivalent. The syntax is more verbose but clearer. $trans_tbl = array( 'Ę' => 'E', 'Ó' => 'O', 'Ą' => 'A', .... ); $s = strtr($s, $trans_tbl); |