PHP wrapper around the chardet
command
You should install chardet:
sudo pip install chardet
sudo ln -s /usr/local/bin/chardetect /usr/local/bin/chardet
sudo apt-get install python-chardet
To use this library install it through Composer, run
composer require yupmin/php-chardet
<?php
//...
use Yupmin\PHPChardet\Chardet;
//...
$chardet = new Chardet();
$chardetContainer = $chardet->analyze('test.txt');
$filePath = $chardetContainer->getFilePath();
$charset = $chardetContainer->getCharset();
$confidence = $chardetContainer->getConfidence();
//...
See LICENSE
for more information