当前位置: 首页>>代码示例>>PHP>>正文


PHP CMbString::removeAccents方法代码示例

本文整理汇总了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);
 }
开发者ID:OpenXtrem,项目名称:mediboard-test,代码行数:13,代码来源:CINSPatient.class.php

示例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) {
//.........这里部分代码省略.........
开发者ID:fbone,项目名称:mediboard4,代码行数:101,代码来源:CImportCim10.class.php


注:本文中的CMbString::removeAccents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。