yupmin / php-chardet
php-chardet
Installs: 2 079
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
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-11-29 03:48:58 UTC
README
Introduction
PHP wrapper around the chardet
command
Table of contents:
Installation
1 - Install chardet
You should install chardet:
Using pip:
sudo pip install chardet sudo ln -s /usr/local/bin/chardetect /usr/local/bin/chardet
On ubuntu linux:
sudo apt-get install python-chardet
2 - Integration in your php project
To use this library install it through Composer, run
composer require yupmin/php-chardet
How to use
Retrieve chardet container
<?php //... use Yupmin\PHPChardet\Chardet; //... $chardet = new Chardet(); $chardetContainer = $chardet->analyze('test.txt'); $filePath = $chardetContainer->getFilePath(); $charset = $chardetContainer->getCharset(); $confidence = $chardetContainer->getConfidence(); //...
License
See LICENSE
for more information