2017 © Pedro Peláez
 

library php-chardet

php-chardet

image

yupmin/php-chardet

php-chardet

  • Tuesday, December 1, 2015
  • by yupmin
  • Repository
  • 1 Watchers
  • 0 Stars
  • 139 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 23 % Grown

The README.md

php-chardet Build Status Coverage Status Packagist Packagist

Introduction

PHP wrapper around the chardet command, (*1)

Table of contents:

Installation

1 - Install chardet

You should install chardet:, (*2)

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, (*3)

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, (*4)

Reference

The Versions