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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -