php中与Encoding.ASCII.GetBytes(vstrEncryptionKey.ToCharArray()
本文关键字:vstrEncryptionKey ToCharArray GetBytes 中与 Encoding ASCII php | 更新日期: 2023-09-27 18:14:28
下面的c#代码在PHP中对应的代码是什么
Encoding.ASCII.GetBytes(vstrEncryptionKey.ToCharArray())
其中vstrEncryptionKey
是变量?
使用ord
函数(http://php.net/ord)和mb_strlen
函数http://php.net/manual/en/function.mb-strlen.php)
<?php
$var = $vstrEncryptionKey;
for($i = 0; $i < mb_strlen($var, 'ASCII'); $i++)
{
echo ord($var[$i]);
}
?>
这是修改的代码从我如何得到一个字符串的字节值在PHP中给出的答案?