Home  >  Article  >  Backend Development  >  请大哥们帮我把这小段代码改成ASP的吧,多谢

请大哥们帮我把这小段代码改成ASP的吧,多谢

WBOY
WBOYOriginal
2016-06-23 14:27:25967browse

function flashdata_decode($s) {    		$r = '';    		$l = strlen($s);    		for($i=0; $i<$l; $i=$i+2) {    			$k1 = ord($s[$i]) - 48;    			$k1 -= $k1 > 9 ? 7 : 0;    			$k2 = ord($s[$i+1]) - 48;    			$k2 -= $k2 > 9 ? 7 : 0;    			$r .= chr($k1 << 4 | $k2);    		}    		return $r;    	}

对PHP不熟,搞不来,多谢啊
主要是  $r .= chr($k1 

回复讨论(解决方案)

PHP strlen 函数
ASP len 函数

PHP ord 函数
ASP asc 函数

PHP | 运算符
ASP or 运算符

PHP  ASP 无 可用连乘 2 代替。比如 
PHP $s[$i]
ASP mid(s, i, 1)

非常感谢,上面那些已经翻译过来了,但是 PHP的chr 与 ASP的 chr /chrw 转过来的有些偏字不一样,ASP转过来是 ?  号,怎么办呀

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn