shouding / mix-string
When unicode characters and ascii characters mixed, according to your needs, calculate the length of the string
1.0.0
2016-06-18 02:59 UTC
Requires
- danielstjules/stringy: ~2.3
This package is not auto-updated.
Last update: 2025-02-10 15:03:49 UTC
README
Description
When unicode characters and ascii characters mixed, according to your needs, calculate the length of the string
Example
need composer
{ "require": { "shouding/mix-string": "1.0.0" } }
>>> require('vendor/autoload.php') => Composer\Autoload\ClassLoader {#162} >>> use Shouding\Mix\Str; => null >>> Str::length("this is a test 中国") => 6 >>> Str::length("this is a test 中国", Str::TYPE_CHAR) => 17 >>> Str::length("this is a test 中国", Str::TYPE_BYTES) => 21