Translit::transliterate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * This file is part of the php-epp2 library.
5
 *
6
 * (c) Gunter Grodotzki <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE file
9
 * that was distributed with this source code.
10
 */
11
12
namespace AfriCC\EPP;
13
14
class Translit
15
{
16
    public static function transliterate($string)
17
    {
18
        // the reason for using this rather "exotic" function in contrary to
19
        // iconv is, that iconv is very unstable. It relies on the correct
20
        // linked library, which means it works different on OSX than on Linux
21
        // also iconv + setlocale is not thread safe, so if you are using IIS
22
        // php-fpm, fastcgi or similar it can/will break
23
        return transliterator_transliterate('Any-Latin; Latin-ASCII; [\u0100-\u7fff] remove', $string);
24
    }
25
}
26