PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Khaled Al-Shamaa   ArCharsetC   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: ArCharsetC
Convert Arabic texts between different encodings
Author: By
Last change: I add two new methods to convert Arabic text represents as HTML entities (for examples ض instead of Dad Arabic character) into UTF-8 (method name is: html2utf) and Windows-1256 (method name is: html2win).
Date: 16 years ago
Size: 3,474 bytes


Class file image Download
= file('test2.html');
$text = implode("<br>", $test);

$charset = $_GET['charset'];
$charset = 'windows-1256';

ini_set('zend.ze1_compatibility_mode', '1');

$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

$text = $text;
$text = $arc->win2iso($text);
$text = $arc->win2utf($text);

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset; ?>">

<meta name="Subject" content="Arabic Character Set Converter" />
<meta name="Description" content="Arabic Character Set Converter" />
<meta name="Classification" content="PHP and Arabic Language" />
<meta name="Keywords" content="Charset, Converter, UTF-8, Windows-1256, PHP, Arabic, Language, Development, Implementation, Open Source, Free, GPL, Classes, Code" />
<meta name="Language" content="English, Arabic" />
<meta name="Author" content="Khaled Al-Shamaa" />
<meta name="Copyright" content="Khaled Al-Shamaa" />
<meta name="Designer" content="Khaled Al-Shamaa" />
<meta name="Publisher" content="Khaled Al-Shamaa" />
<meta name="Distribution" content="Global" />
<meta name="Robots" content="INDEX,FOLLOW" />
<meta name="City" content="Aleppo" />
<meta name="Country" content="Syria" />

<link rel="shortcut icon" href="../favicon.ico" />
<link rel="stylesheet" type="text/css" href="style.css" media="all" />
<title>Arabic Character Set Converter</title>


<div style="width: 80%; position:absolute; left:10%; top:0%; z-index:1">
<br />
<div class="tabArea" align="center">
  <a class="tab" href="example.php">Example</a>
  <a class="tab" href="about.html">About</a>
  <a class="tab" href="">Homepage</a>

<div class="Paragraph" 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>
<font face="Tahoma" size="2">
<?php echo $text; ?>

<table border="0" cellspacing="0" align="left">
    <td bgcolor="#448800">&nbsp;&nbsp;</td>
    <td bgcolor="#66aa00">&nbsp;&nbsp;</td>
    <td bgcolor="#77bb00">&nbsp;&nbsp;</td>
    <td bgcolor="#aadd00">&nbsp;&nbsp;</td>
    <td bgcolor="#eeff66">&nbsp;&nbsp;</td>
          <script src="" type="text/javascript">
          <script type="text/javascript">
          _uacct = "UA-1268287-1";