PHP Classes

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Mickey Chan  >  Chinese Party  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Usage Example
Class: Chinese Party
Convert Chinese text encodings
Author: By
Last change:
Date: 8 years ago
Size: 1,045 bytes


Class file image Download
 * Traditional Chinese <-> Simplified Chinese Example
 * 2006-05-23 20:57


$cconv =& new chinese_party();

if (isset(
$_POST['tchi2schi'])) {
$strContent = $cconv->utf8_tchi2schi($_POST['strContent']);
} elseif (isset(
$_POST['schi2tchi'])) {
$strContent = $cconv->utf8_schi2tchi($_POST['strContent']);
} else
$strContent = "";
<form action="<?=basename(__FILE__)?>" method="post">
<textarea name="strContent" rows="6" cols="60"><?=$strContent?></textarea><br />
<input type="submit" name="tchi2schi" value="繁體轉簡體" />
<input type="submit" name="schi2tchi" value="簡體轉繁體" />
<hr />
<p><b>已知在Big5字碼裡無法正常轉換為GB2312的中文字:</b><br />咁(<?=$cconv->uniord('咁');?>);搵(<?=$cconv->uniord('搵');?>);冇(<?=$cconv->uniord('冇');?>);磡(<?=$cconv->uniord('磡');?>);輋(<?=$cconv->uniord('輋');?>);</p>