本文整理汇总了PHP中AkInflector::unaccent方法的典型用法代码示例。如果您正苦于以下问题:PHP AkInflector::unaccent方法的具体用法?PHP AkInflector::unaccent怎么用?PHP AkInflector::unaccent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AkInflector
的用法示例。
在下文中一共展示了AkInflector::unaccent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getUrlSafeName
function _getUrlSafeName(&$record,$name)
{
$safe_name = strtolower($name);
$safe_name = str_replace(array('ñ','ä','ü','ö','ß'),array('ny','ae','ue','oe','ss'), $safe_name);
$safe_name = AkInflector::unaccent($safe_name);
$specialCharsUnsafe =array("¡","!"," ","`","]","[","~","^","\\","|","}","{","%","#",">","<",
"'",'"',"",'@','$','&',
',','/',':',';','=','?');
$specialCharsSafe = array("-exclamation-","-exclamation-","-","-accent-","-rbracket-","-lbracket-","-tilde-","-caret-","-backslash-","-pipe-","-rbrace-","-lbrace-","-percent-","-hash-","-more-","-less-",
"","",'-','-at-','-dollar-','-and-',
'-comma-','-or-','-colon-','-semicolon-','-equals-','-question-');
foreach (array_keys($record->sluggable->custom_replacements) as $customKey) {
array_unshift($specialCharsUnsafe,$customKey);
array_unshift($specialCharsSafe,$record->sluggable->custom_replacements[$customKey]);
}
$safe_name = str_replace($specialCharsUnsafe,
$specialCharsSafe,
$safe_name);
$safe_name = preg_replace('/-+/','-',$safe_name);
$safe_name = trim($safe_name,'-');
return $safe_name;
}
示例2: urlize
static function urlize($text)
{
return trim(AkInflector::underscore(AkInflector::unaccent($text)), '_');
}
示例3: Test_of_unnaccent
function Test_of_unnaccent()
{
$this->assertEqual('AAAAAAACEEEEIIIIDNOOOOOOUUUUYTsaaaaaaaceeeeiiiienoooooouuuuyty', AkInflector::unaccent('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ'));
}