bfunky/ascii

A library to validate strings and transliterate to ascii encoding

1.0.8 2018-11-09 13:26 UTC

This package is auto-updated.

Last update: 2024-11-10 05:09:07 UTC


README

Scrutinizer Code Quality Build Status Code Coverage

A library to validate strings and transliterate to ascii encoding

Usage as static class

Validate if given value is a valid ascii string

//returns true
$result = Ascii::isValid('this string is valid');

//returns false
$result = Ascii::isValid('cette chaîne est valide');

Transliterate a string

//print `cette chaine est valide`
echo Ascii::transliterate('cette chaîne est valide');

Usage creating an instance

Validate if given value is a valid ascii string

$ascii = new Ascii();

//returns true
$result = $ascii->isValid('this string is valid');

//returns false
$result = $ascii->isValid('cette chaîne est valide');

Transliterate a string

$ascii = new Ascii();
//print `cette chaine est valide`
echo $ascii->transliterate('cette chaîne est valide');