No description, website, or topics provided.
PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
php
README.md

README.md

WordMarker

Description

This is a simple class for adding markers befor specified words and after them. It does not depend on the order of specified words to add markers.

Usage

require_once('WordMarker.php');

$listWord = array(
    'security',
    'security hole',
);

$str = '... hole security hole ...';

$marker = new WordMarker();
$marker->setMarker('<b>', '</b>');
$result = $marker->addMarker($str, $listWord);
print $result;   // '... hole <b>security hole</b> ...'