Update string.utils.php
This commit is contained in:
parent
f63cfd3a4b
commit
5a80fad2c7
|
@ -221,13 +221,17 @@ if(!check_function_exists("remove_utf8_bom")) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!check_function_exists("get_tokenized_text")) {
|
if(!check_function_exists("get_tokenized_text")) {
|
||||||
function get_tokenized_text($text, $delimiters=array(",", " ", "|", "-", "+","\t","\r\n","\n")) {
|
function get_tokenized_text($text, $delimiters=array()) {
|
||||||
return array_filter(multi_explode($delimiters, $text));
|
if(count($delimiters) > 0) {
|
||||||
|
return array_filter(multi_explode($delimiters, $text));
|
||||||
|
} else {
|
||||||
|
return preg_split('/\s+/', $text, -1, PREG_SPLIT_NO_EMPTY);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!check_function_exists("get_highlighted_html_by_words")) {
|
if(!check_function_exists("get_highlighted_html_by_words")) {
|
||||||
function get_highlighted_html_by_word($word, $text, $delimiters=array(",", " ", "|", "-", "+","\t","\r\n","\n")) {
|
function get_highlighted_html_by_word($word, $text, $delimiters=array()) {
|
||||||
$html = $text;
|
$html = $text;
|
||||||
|
|
||||||
$words = get_tokenized_text($word, $delimiters);
|
$words = get_tokenized_text($word, $delimiters);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user