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


PHP CMbString::normalizeUtf8方法代码示例

本文整理汇总了PHP中CMbString::normalizeUtf8方法的典型用法代码示例。如果您正苦于以下问题:PHP CMbString::normalizeUtf8方法的具体用法?PHP CMbString::normalizeUtf8怎么用?PHP CMbString::normalizeUtf8使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CMbString的用法示例。


在下文中一共展示了CMbString::normalizeUtf8方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: log

 /**
  * Construct the datum for logging
  *
  * @param array   $names_types Types
  * @param string  $contexte    Contexte
  * @param integer $user_id     User who have make the search
  * @param string  $words       the words of the search
  * @param bool    $aggregation aggregation or not
  *
  * @return void
  */
 function log($names_types, $contexte, $user_id, $words, $aggregation)
 {
     if (!$names_types) {
         $names_types = array();
     }
     $document = array();
     $document['aggregation'] = $aggregation;
     $document['body'] = CMbString::normalizeUtf8($words);
     $document['user_id'] = $user_id;
     $document['types'] = implode(" ", $names_types);
     $document['date'] = CMbDT::format(null, "%Y/%m/%d");
     $this->createClient();
     $index = $this->loadIndex($this->loadNameIndex());
     $type = $index->getType($contexte);
     $log = $type->createDocument('', $document);
     $type->addDocument($log);
     $type->getIndex()->refresh();
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:29,代码来源:CSearchLog.class.php

示例2: array

$authors = array();
$author_ids = array();
$patients = array();
try {
    $date = $client_index->constructWordsWithDate($_date, $_min_date, $_max_date);
    $results_query = $client_index->searchQueryString($words, $start, 30, $names_types, $aggregate, $sejour_id, $specific_user, null, $date, $fuzzy_search);
    $results = $results_query->getResults();
    $time = $results_query->getTotalTime();
    $nbresult = $results_query->getTotalHits();
    // traitement des résultats
    $patient_ids = array();
    foreach ($results as $result) {
        $var = $result->getHit();
        $author_ids[] = $var["_source"]["author_id"];
        $patient_ids[] = $var["_source"]["patient_id"];
        $var["_source"]["body"] = CMbString::normalizeUtf8($var["_source"]["body"]);
        $array_results[] = $var;
        // Traitement des highlights
        $highlights = $result->getHighlights();
        if (count($highlights) != 0) {
            $array_highlights[] = mb_convert_encoding(implode(" [...] ", $highlights['body']), "WINDOWS-1252", "UTF-8");
        } else {
            $array_highlights[] = "";
        }
    }
    // traitement des auteurs
    foreach ($author_ids as $author) {
        $authors[$author] = CMbObject::loadFromGuid("CMediusers-{$author}");
        $authors[$author]->loadRefFunction();
    }
    // traitement des patients
开发者ID:fbone,项目名称:mediboard4,代码行数:31,代码来源:ajax_result_search.php

示例3: normalizeEncoding

 /**
  * Method to normalize text
  *
  * @param String $text The text to normalize
  *
  * @return String
  */
 function normalizeEncoding($text)
 {
     $text = mb_convert_encoding($text, "UTF-8", "Windows-1252");
     return CMbString::normalizeUtf8($text);
 }
开发者ID:fbone,项目名称:mediboard4,代码行数:12,代码来源:CSearch.class.php


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