map_ar user user user user user user if in_array map map_ar and in_arr

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
$map_ar = [
'x' => [
$user['x'] + 1,
$user['x'] - 1,
$user['x']
],
'y' => [
$user['y'] + 1,
$user['y'] - 1,
$user['x']
]
];
if(in_array($map['x'], $map_ar['x']) and in_array($map['y'], $map_ar['y'])) echo 'можно идти';