Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ivantcholakov/transliterate

A PHP class for transliteration
https://github.com/ivantcholakov/transliterate

php transliteration

Last synced: 3 months ago
JSON representation

A PHP class for transliteration

Awesome Lists containing this project

README

        

Transliterate.php
=================

A PHP class for transliteration

Simple examples:

```php
echo Transliterate::to_ascii('Фёдор Михайлович Достоевский', 'russian');
// Result: Fedor Mihajlovich Dostoevskij

echo '
';

echo Transliterate::to_ascii('Фьодор Михайлович Достоевски', 'bulgarian');
// Result: Fyodor Mihaylovich Dostoevski
```

Example on CodeIgniter framework, making a slug for permalink creation:

```php
$product_name = 'Авторско колие с естествен камък тюркоаз';

$product_name_ascii = Transliterate::to_ascii($product_name);
// Result: Avtorsko kolie s estestven kamak tyurkoaz

$product_slug = url_title($product_name_ascii, '-', true);
echo $product_slug;
// Result: avtorsko-kolie-s-estestven-kamak-tyurkoaz
```

Author: Ivan Tcholakov , 2012-2021

License: The MIT License