A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/alecrabbit/php-wcwidth below:

alecrabbit/php-wcwidth: Calculate width of unicode strings rendered to a terminal

πŸ‡ΊπŸ‡¦ πŸ‡Ό PHP Wide Character Width

This is kinda port of python's jquast/wcwidth

🌐 Unicode release files

$ composer require alecrabbit/php-wcwidth
use function AlecRabbit\WcWidth\wcwidth;
use function AlecRabbit\WcWidth\wcswidth;

echo wcwidth('a'); // 1
echo wcwidth('Γ©'); // 1
echo wcwidth('🐘'); // 2
echo wcswidth('🐘🐘🐘'); // 6

echo wcwidth('🐘🐘🐘'); // 2 - only first char is considered

see doc/usage.md for more details.

Note ‼️ Experimental feature.

For improved performance, consider leveraging the Foreign Function Interface (FFI) extension, if available. To enable this feature, set the USE_FFI environment variable to true.

Note When using ffi extension version value is ignored completely.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4