$max_score) { $max_score = $article['score']; } if ($max_score && ($article['score'] / $max_score) < 0.25) { break; } $txt = strip_tags($article['content']); if (hesk_mb_strlen($txt) > $hesk_settings['kb_substrart']) { $txt = hesk_mb_substr($txt, 0, $hesk_settings['kb_substrart']).'...'; } $articles[] = array( 'id' => $article['id'], 'subject' => $article['subject'], 'contentPreview' => $txt, 'hiddenInputValue' => $article['id'].'|'.stripslashes( hesk_input($article['subject']) ) ); } print json_encode($articles);