Location: PHPKode > scripts > ArCharsetC > archarsetc/example.php
<?php
$test = file('example.txt');
$text = implode("<br>", $test);

if(isset($_GET['charset'])){
    $charset = $_GET['charset'];
}else{
    $charset = 'windows-1256';
}

include('ArCharsetC.class.php');
$arc = new ArCharsetC();

/*
Available methods for this class include:
>> win2iso: to convert Windows-1256 character set into ISO 8859-6 character set
>> win2utf: to convert Windows-1256 character set into UTF-8 character set
>> iso2win: to convert ISO 8859-6 character set into Windows-1256 character set
>> iso2utf: to convert ISO 8859-6 character set into UTF-8 character set
>> utf2win: to convert UTF-8 character set into Windows-1256 character set
>> utf2iso: to convert UTF-8 character set into ISO 8859-6 character set
*/

switch($charset){
    case 'windows-1256':
        $text = $text;
        break;
    case 'iso-8859-6':
        $text = $arc->win2iso($text);
        break;
    case 'utf-8':
        $text = $arc->win2utf($text);
        break;
}


?>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>"></head><body dir="rtl">
<a href="example.php?charset=windows-1256">Windows-1256</a> |
<a href="example.php?charset=iso-8859-6">ISO 8859-6</a> |
<a href="example.php?charset=utf-8">UTF-8</a><hr>
<?php echo $text; ?>
</body></html>
Return current item: ArCharsetC