Update with get address method and utf8 bom replacer

This commit is contained in:
2024-09-03 12:12:11 +09:00
parent 51fef30364
commit 561be4bce6
9 changed files with 133 additions and 13 deletions

View File

@@ -134,6 +134,18 @@ class Strings
$path
) ?? $path;
}
/**
* Remove UTF8 BOM Byte string from line
* Note: this is often found in CSV files exported from Excel at the first row, first element
*
* @param string $text
* @return string
*/
public static function stripUTF8BomBytes(string $text): string
{
return trim($text, pack('H*', 'EFBBBF'));
}
}
// __END__