PHP 8.5.0 Alpha 4 available for testing

Voting

: max(two, one)?
(Example: nine)

The Note You're Voting On

hartmut at php dot net
1 year ago
This function operates on bytes, not characters, so it is only of limited use when operating on UTF-8 encoded Unicode strings.

Running the input strings through Normalizer ( https://www.php.net/manual/en/class.normalizer.php ) can at least somewhat help with this, but you still need to be aware that replacing, inserting or deleting a single UTF-8 encoded unicode character can wrongly report a cost of 2, 3 or 4 depending on the length of the UTF-8 sequence representing it, or even more when dealing with combining character modifiers.

<< Back to user notes page

To Top