|
I've never done or seen this in php, but I guess it's possible to just use numbers instead and when printing them, adding a fix number and have the number converted into a ASCII character. All characters have a number in the ASCII table (can't remeber where it starts), so A would be represented by lets say 63. B=64, C=65 and so on. After Z comes a, b, c and so on.
So you could simply have two fields, X and Y coordinate, which are both numbers. A coordinate could then be i.e. (2,5). By adding 63 (again, dont remeber the real number but you can find ASCII tables on the web) you would get (65,68) and by converting them to characters you would get (C,F).
EDIT: And, the point being that is is simpler to find the fileds next to the one selected when representing them with numbers. To find north, add 1 to Y. To find south, substract 1 from Y. East and west would be X+1 and X-1. In the same manner, north east would be (x+1, Y+1).
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
Last edited by lizciz; 01-06-2010 at 07:38 AM..
|