reisraff / accentuation

该仓库通过在字符串中替换带重音符号的字符来制作解析器

2.0.2 2016-02-13 23:25 UTC

This package is auto-updated.

Last update: 2024-08-28 03:51:39 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License Build Status

该库通过将所有带重音符号的字符替换为不带重音符号的字符来工作。

使用方法

在您的 composer.json 中添加

"require" : {
    "reisraff/accentuation" : ">=2.0.2"
}

在您的代码中使用

<?php

namespace MyNameSpace;

use Accentuation\Accentuation;

class MyClass
{
    public function test()
    {
        return Accentuation::remove('This string will be returned without accentuation áéíóú');
    }
}

测试

要运行测试套件,您需要通过 composer 安装依赖项,然后运行 PHPUnit。

$ composer install
$ phpunit

您也可以使用以下命令来运行最常见的 QA 检查,如 php -lphpcsphpunit

$ ant check