Overview

Namespaces

  • Composer
    • Autoload
  • Geekwright
    • RegDom
  • League
    • OAuth2
      • Client
        • Provider
  • None
  • Xmf
    • Database
    • Jwt
    • Key
    • Module
      • Helper

Classes

  • Assert
  • Debug
  • FilterInput
  • Highlighter
  • IPAddress
  • Language
  • Metagen
  • Random
  • Request
  • StopWords
  • Yaml
  • Overview
  • Namespace
  • Class
  • Tree

Class Highlighter

Highlighter

Namespace: Xmf
Package: Xmf
Category: Xmf\Highlighter
Copyright: 2011-2016 XOOPS Project (http://xoops.org)
License: GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
Author: Richard Griffith richard@geekwright.com
Link: http://xoops.org
Located at lass/libraries/vendor/xoops/xmf/src/Xmf/Highlighter.php
Methods summary
public static string
# apply( string|string[] $words, string $body, string $pre = '<mark>', string $post = '</mark>' )

Apply highlight to words in body text

Apply highlight to words in body text

Surround occurrences of words in body with pre in front and post behind. Considers only occurrences of words outside of HTML tags.

Parameters

$words
words to highlight
$body
body of html text to highlight
$pre
string to begin a highlight
$post
string to end a highlight

Returns

string
highlighted body
protected static mixed
# splitOnTag( string $needle, string $haystack, string $pre, string $post )

find needle in between html tags and add highlighting

find needle in between html tags and add highlighting

Parameters

$needle
string to find
$haystack
html text to find needle in
$pre
insert before needle
$post
insert after needle

Returns

mixed
return from preg_replace_callback()
Constants summary
string ENCODING

mbstring encoding

mbstring encoding

# 'UTF-8'
API documentation generated by ApiGen