PHP get ASCII code of a character -
How do I get the ASCII code in PHP ??
When I try:
$ h = dechex (ord ('' ')); $ H;
I'm getting C3
when I should get F1
for example :
for '' '-' & gt; % F1 for & # 39; f & gt; % Ba
How can I get this?
Thank you in advance!
As they tell you in comments, standard is not ASCII Extended ASCII is present on the table, but your source file can be saved in UTF-8 and thus gets stored with different bytes. You can try setting your editor to save the document in a different charset.
However , what you are doing is really dangerous as you can see that the encoding can change, always writing a bad name in the source file would be a bad idea Which are not part of the standard ASCII.
Why do you need to take this action? Is there any other way? Can not you use UTF-8?
Comments
Post a Comment