Update string.utils.php

This commit is contained in:
Namhyeon Go 2019-09-26 17:05:03 +09:00 committed by GitHub
parent cd1ae416f8
commit 8eadbc8cb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -211,6 +211,15 @@ if(!check_function_exists("parse_pipelined_data")) {
}
}
// https://stackoverflow.com/questions/10290849/how-to-remove-multiple-utf-8-bom-sequences
if(!check_function_exists("remove_utf8_bom")) {
function remove_utf8_bom($text) {
$bom = pack('H*','EFBBBF');
$text = preg_replace("/^$bom/", '', $text);
return $text;
}
}
if(!check_function_exists("get_tokenized_text")) {
function get_tokenized_text($text, $delimiters=array(",", " ", "|", "-", "+")) {
return array_filter(multi_explode($delimiters, $text));