c# - What is the php equivalent for Encoding.ASCII.GetBytes(vstrEncryptionKey.ToCharArray()) -
this question has answer here:
- how byte values of string in php? 4 answers
what php equivalent following c# code
encoding.ascii.getbytes(vstrencryptionkey.tochararray())
where vstrencryptionkey
variable?
use ord
function (http://php.net/ord) , mb_strlen
function 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]); } ?>
this modified code answer given in how byte values of string in php?
Comments
Post a Comment