PHP code example of descom / file_encoding

1. Go to this page and download the library: Download descom/file_encoding library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

descom / file_encoding example snippets


encodeFile($file, $encoding_to, $encodings_detected);

use Descom\File\Encoding;

$codification = new Encoding();

$file = 'file.txt';
$encoding_to = 'UTF-8';
$encodings_detected = 'UTF-8,ISO-8859-1,WINDOWS-1252';

$result = $codification->encodeFile($file, $encoding_to, $encodings_detected);

$encoding_to = 'UTF-8';
$encodings_detected = 'UTF-8,ISO-8859-1,WINDOWS-1252';