本文整理汇总了PHP中CMbString::removeAccents方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbString::removeAccents方法的具体用法?PHP CMbString::removeAccents怎么用?PHP CMbString::removeAccents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMbString
的用法示例。
在下文中一共展示了CMbString::removeAccents方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formatString
/**
* Formate la chaine pour l'INSC
*
* @param String $string String
*
* @return String
*/
static function formatString($string)
{
$String_no_accent = CMbString::removeAccents($string);
$normalize = preg_replace("/([^A-Za-z])/", " ", $String_no_accent);
return mb_strtoupper($normalize);
}
示例2: run
/**
* Main function
*
* @return void
*/
function run()
{
$content = trim(file_get_contents($this->input));
$lines = preg_replace_callback('/[^"|]\\n/', array('CImportCim10', 'removeLineFeeds'), $content);
$lines = explode("\n", $lines);
$headers = array('code', 'type', 'origine', 'date', 'label');
$insertions = array('chapter' => array(), 'group' => array(), 'category' => array(), 'subcategory' => array(), 'subdivision' => array(), 'inclusion' => array(), 'exclusion' => array(), 'definition' => array(), 'memo' => array(), 'glossaire' => array());
$deletions = array('inclusion' => array(), 'exclusion' => array(), 'definition' => array(), 'memo' => array(), 'glossaire' => array(), 'subdivision' => array(), 'subcategory' => array(), 'category' => array(), 'group' => array());
$entry_chapter = null;
foreach ($lines as $_row => $_line) {
if ($_row == 0) {
continue;
}
$entry = str_getcsv($_line, '|', '"');
if (count($entry) != 5) {
continue;
}
$entry = array_combine($headers, str_getcsv($_line, '|', '"'));
$entry['type'] = strtolower(CMbString::removeAccents($entry['type']));
switch ($entry['type']) {
case 'creation chapitre':
if (strpos($entry['code'], 'Chapitre') !== false) {
$entry_chapter = $entry;
} else {
$insertions['chapter'][] = array($entry, $entry_chapter);
}
break;
case 'creation groupe':
$insertions['group'][] = $entry;
break;
case 'creation categorie':
$insertions['category'][] = $entry;
break;
case 'creation sous-categorie':
$insertions['subcategory'][] = $entry;
break;
case 'subdivision de libelle':
$insertions['subdivision'][] = $entry;
break;
case 'ajout note d\'inclusion':
$insertions['inclusion'][] = $entry;
break;
case 'ajout note d\'exclusion':
$insertions['exclusion'][] = $entry;
break;
case 'ajout note de definition':
$insertions['definition'][] = $entry;
break;
case 'ajout note d\'utilisation':
$insertions['memo'][] = $entry;
break;
case 'suppression subdivision':
$deletions['subdivision'][] = $entry;
break;
case 'suppression sous-categorie':
$deletions['subcategory'][] = $entry;
break;
case 'suppression categorie':
$deletions['category'][] = $entry;
break;
case 'suppression groupe':
$deletions['group'][] = $entry;
break;
case 'suppression note d\'exclusion':
$deletions['exclusion'][] = $entry;
break;
case 'suppression note d\'inclusion':
$deletions['inclusion'][] = $entry;
break;
case 'suppression note d\'utilisation':
$deletions['memo'][] = $entry;
break;
case 'suppression note de definition':
$deletions['definition'][] = $entry;
break;
case 'suppression note d\'utilisation et d\'inclusion':
$labels = explode('#EOL', $entry['label']);
foreach ($labels as $_label) {
$_entry = $entry;
/* Utilisation note */
if (strpos($_label, 'Note') === 0) {
$_entry['label'] = str_replace('Note : ', '', $_label);
$deletions['memo'][] = $_entry;
} else {
$_entry['label'] = str_replace('Comprend : ', '', $_label);
$deletions['inclusion'][] = $_entry;
}
}
break;
default:
continue;
break;
}
}
foreach ($insertions as $_type => $_insertions) {
//.........这里部分代码省略.........