麻辣堂|资源主站|开发论坛|在线手册
首页 Apache Linux Java MySQL 注册帮助 
PHP项目开发组是PHP开发资源网于2007组年建成立的项目开发团队,目前核心开发成员有27人, 项目协作成员8名.下设7个开发组,主要承接大/中型网站项目开发任务。

    由于开发任务较多,人员比较紧张,现面向社会招聘全职或者兼职开发人员,不管你是在校大学生,还是全职开发人员,以及SOHO都可以联系本站,我们可以长期合作,并为您带来丰厚的报酬。
  您现在的位置:PHP开发资源网 > 麻辣堂 > 详细资料
待解决
救命呀。快来帮我看看这个是什么问题怎么转换不过来。
悬赏分:20 - 2007年08月18日

[PHP]<?php
class CONVERT{
var $matrix=array(
'0'=>'a',
'1'=>'J',
'2'=>'i',
'3'=>'f',
'4'=>'h',
'5'=>'e',
'6'=>'d',
'7'=>'b',
'8'=>'g',
'9'=>'c',
'a'=>'9',
'b'=>'j',
'c'=>'K',
'd'=>'6',
'e'=>'k',
'f'=>'9',
'g'=>'M',
'h'=>'l',
'i'=>'7',
'j'=>'5',
'k'=>'L',
'l'=>'N',
'm'=>'I',
'n'=>'m',
'o'=>'A',
'p'=>'P',
'q'=>'H',
'r'=>'1',
's'=>'n',
't'=>'4',
'u'=>'B',
'v'=>'O',
'w'=>'0',
'x'=>'2',
'y'=>'Q',
'z'=>'C',
'A'=>'3',
'B'=>'D',
'C'=>'z',
'D'=>'G',
'E'=>'y',
'F'=>'v',
'G'=>'F',
'H'=>'R',
'I'=>'w',
'J'=>'E',
'K'=>'q',
'L'=>'V',
'M'=>'U',
'N'=>'x',
'O'=>'p',
'P'=>'T',
'Q'=>'S',
'R'=>'u',
'S'=>'o',
'T'=>'W',
'U'=>'t',
'V'=>'Y',
'W'=>'r',
'X'=>'Z',
'Y'=>'X',
'Z'=>'s'
);
function encode($str){
$str2="";
for($i=0;$i $codechar=substr($str,$i,1);
if($this->matrix[$codechar]!=""){
$str2.=$this->matrix[$codechar];
}
else{
$str2.=$codechar;
}
}
return $str2;
}
function decode($str){
$unmatrix;
$x=0;
foreach($this->matrix as $key=>$value){
echo "$x";
$x++;
$unmatrix[$value]=$key;
echo "$value-->$key";
}
echo $unmatrix['a'];
echo "".count($this->matrix)."".count($unmatrix)."";
print_r($unmatrix);
$str2="";
for($i=0;$i $decodechar=substr($str,$i,1);
if($unmatrix[$decodechar]!=""&&$unmatrix[$decodechar]!=0){
$str2.=$unmatrix[$decodechar];
}else{
$str2.=$decodechar;
}
}
return $str2;
}
}
?>[/PHP]

下面测试代码
[PHP]<?php
require("../config.php");
// require("dbi_class.php");
require("convert_class.php");
$conver=new CONVERT;
echo $conver->encode("0123456789abcdefghijklmn");
echo $conver->decode($conver->encode("0123456789abcdefghijklmn"));

?>[/PHP]

提问者:glzaboy   08-18 09:09
答复
路过。。。顺便帮顶:)
回答者:玉米づ冰冻可乐 - 瓦岗村民 8-22 09:10
我也来回答:
不管你有没有帮助我们,瓦岗寨8万村民将感谢你。。。。。

为防止灌水,您需要计算一道数学题: 答案:
21 + 10 = ? 请将计算结果填在上面

 
[]
©2007 PhpRes.COM