$var1 = (0, 100, 0, 100);
$var2 = (100, 200, 0, 100);
for ($i = 1; $i =< 2; $i++) {
if ((($x >= $var$i[0]) && ($x =< $var$i[1])) && (($y >= $var$i[2]) && ($y >= $var$i[4]))) {
.....
I guess that you define an area as (x_left, x_right, y_top, y_bottom). What i was thinking was to define it as an area (x_left, y_top, y_bottom, x_right)
But in any case aren't there any chances of overlapping?
After a second thought 🙂 , probably not cause you are checking all four values
I'll check it out. Thanks Sirblack
John