Esempio n. 1
0
function CONSOLE($text, $newline = '<p>')
{
    $text = replaceTag($text, '{red}', "<span style=\"color: red;\">", "</span>");
    $text = replaceTag($text, '{green}', "<span style=\"color: green;\">", "</span>");
    $text = replaceTag($text, '*', "<b>", "</b>");
    echo "{$newline}{$text}";
}
Esempio n. 2
0
function breakKey($g, $h, $j = 0)
{
    $h = mb_strtolower($h, "UTF-8");
    $l = explode(".", $g);
    $n = '';
    $o = explode(" ", $h);
    $p = array();
    $q = array();
    foreach ($l as $r => $s) {
        $s = mb_strtolower($s, "UTF-8");
        $t = explode(" ", $s);
        $u = array_intersect($o, $t);
        $p[$r] = count($u);
        $q[$r] = $u;
    }
    arsort($p);
    $w = 0;
    foreach ($p as $r => $s) {
        $w++;
        if (isset($l[$r]) && isset($q[$r])) {
            $n = $n . replaceTag(cut_string($l[$r], 200), $q[$r]) . '. ';
        }
        if ($w == 3) {
            break;
        }
    }
    unset($u);
    unset($p);
    unset($q);
    if ($j == 1) {
        $x->text .= strip_tags($n);
    }
    $n = str_replace("</b>", " ", $n);
    return $n;
}
Esempio n. 3
0
function breakKey($content, $title, $tag = 0)
{
    $title = mb_strtolower($title, "UTF-8");
    $array = explode(".", $content);
    $contentReturn = '';
    $arrayKey = explode(" ", $title);
    $arraySort = array();
    $arResult = array();
    foreach ($array as $key => $value) {
        $value = mb_strtolower($value, "UTF-8");
        $arrayCau = explode(" ", $value);
        $result = array_intersect($arrayKey, $arrayCau);
        $arraySort[$key] = count($result);
        $arResult[$key] = $result;
    }
    arsort($arraySort);
    $i = 0;
    foreach ($arraySort as $key => $value) {
        $i++;
        if (isset($array[$key]) && isset($arResult[$key])) {
            $contentReturn = $contentReturn . replaceTag(cut_string($array[$key], 200), $arResult[$key]) . '. ';
        }
        if ($i == 3) {
            break;
        }
    }
    unset($result);
    unset($arraySort);
    unset($arResult);
    if ($tag == 1) {
        $this->text .= strip_tags($contentReturn);
    }
    $contentReturn = str_replace("</b>", " ", $contentReturn);
    return $contentReturn;
}