c# - What is the php equivalent for Encoding.ASCII.GetBytes(vstrEncryptionKey.ToCharArray()) -


this question has answer here:

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

Popular posts from this blog

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -

python - How to create a legend for 3D bar in matplotlib? -