本文整理汇总了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();
}
示例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
示例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);
}