I have just uploaded the next version of the Portable UTF-8, PHP unicode library. This version adds 9 UTF-8 string functions to the library. There are a few bug fixes, and also some performance optimizations, but the release was mainly to extend the functionality of the library.
utf8_string– Makes a string from UTF-8 code points.
utf8_substr_count– Count the number of sub string occurrences. Replacement for
is_ascii– Checks if a string is 7 bit ASCII.
utf8_range– Returns an array of characters between two codepoints (int or hex) or UTF8 characters. Replacement for
utf8_hash– Generates a hash/string of random UTF-8 characters.
utf8_chr_map– Applies callback to all UTF-8 characters.
utf8_access– Provides a way to access individual UTF-8 characters. Replacement for
utf8_str_sort– Sort ascending/descending with respect to codepoints of all characters.
utf8_strip_tags– Replacement for PHP’s
Optimizations & Improvements:
utf8_bomnow in-lines the BOM string instead of creating the string using
packand caching it as a
utf8_chrnow accepts hexadecimal codepoints.
utf8_splithas been improved. New version uses PCRE and is better and faster.
utf8_substr– improved consistency with
extension_loadedwas misspelled as
extension_lodedin v 1.1 Line 50 – reported by Goran Jurić.