yupmin / php-chardet
php-chardet
1.0.1
2015-10-27 13:00 UTC
Requires
- php: >=5.3
- symfony/filesystem: ~2.3
- symfony/process: ~2.3
Requires (Dev)
- phpunit/phpunit: ~4.0
- satooshi/php-coveralls: 0.7.*@dev
- squizlabs/php_codesniffer: ~2.0
This package is auto-updated.
Last update: 2024-08-29 03:18:04 UTC
README
介绍
PHP 对 chardet 命令的包装
目录
安装
1 - 安装 chardet
您应该安装 chardet
使用 pip
sudo pip install chardet sudo ln -s /usr/local/bin/chardetect /usr/local/bin/chardet
在 Ubuntu Linux 上
sudo apt-get install python-chardet
2 - 在您的 PHP 项目中集成
要使用此库,请通过 Composer 安装,运行
composer require yupmin/php-chardet
如何使用
检索 chardet 容器
<?php //... use Yupmin\PHPChardet\Chardet; //... $chardet = new Chardet(); $chardetContainer = $chardet->analyze('test.txt'); $filePath = $chardetContainer->getFilePath(); $charset = $chardetContainer->getCharset(); $confidence = $chardetContainer->getConfidence(); //...
许可证
更多信息请参阅 LICENSE