Well, what I meant to do is ord(somechar) - ord('0') by doing somechar - '0'. It is true in C but I just realized in PHP both will be first cast into int (literally, instead of the ASCII value) and it happens to give out the same result. I do C/C++ programming most of my time...

I'll correct this.