Jump to content

[SOLVED] Interpreting a char as an int?


monkey_05_06

Recommended Posts

Is there any function that can be used to interpret a char as an int? AFAIK PHP doesn't distinguish between chars and strings (a char is simply a string with a length of 1 (right?)), so I haven't found/can't think of a way to do this. I imagine I might not be coming across very clear right now, so let me try to explain what I want. I want to convert a char, say 'A' to it's appropriate integer value, i.e., 65. Everything I've tried as far as conversion has simply led to the chars/strings casting to 0.

 

Thanks for any help with this.

 

- monkey

Link to comment
https://forums.phpfreaks.com/topic/46693-solved-interpreting-a-char-as-an-int/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.