本文整理汇总了PHP中string::utf2win方法的典型用法代码示例。如果您正苦于以下问题:PHP string::utf2win方法的具体用法?PHP string::utf2win怎么用?PHP string::utf2win使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类string
的用法示例。
在下文中一共展示了string::utf2win方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: highlight
function highlight($query, $content)
{
$point_dl = 100;
$query = string::utf2win($query);
$content = string::utf2win($content);
$content = strip_tags($content);
$content_st = $content_and = '';
$point = stripos($content, $query);
$point1 = $point - $point_dl;
if ($point1 < 0) {
$point1 = 0;
} else {
$content_st = '...';
}
$len = strlen($content);
$point2 = $point + $point_dl;
if ($point2 < $len) {
$content_end = '...';
} else {
$content_end = '';
}
$content = $content_st . substr($content, $point1, $point2) . $content_end;
$content = str_ireplace($query, '<span style="background-color: yellow; color: black;">' . $query . '</span>', $content);
$query = string::win2utf($query);
$content = string::highlight(string::win2utf($content), $query);
return $content;
}
示例2: row
function row()
{
$data = func_get_args();
self::$row++;
$count = count($data);
for ($i = 0; $i < $count; $i++) {
$cell = string::utf2win($data[$i]);
self::writeCell($cell, self::$row, $i);
}
}