Artificial intelligent assistant

表のデータをプログラムで表すスマートな書き方を教えて下さい。 `test.com/hogehoge/?yoko=2&tate=3`URL2 2() 23"1,2,3" ![]( ①if& <?php $result = null; if($yoko == 1 && 1 <= $tate && $tate <= 3) $result = array(1,2); else if($yoko == 2 && 1 <= $tate && $tate <= 3) $result = array(1,2,3); else if(1 <= $yoko && $yoko <= 3 && 1 <= $tate && $tate <= 4) $result = array(2,3); # ?> <?php $data = array( array(array(1,2),array(1,2,3),array(2,3),array(2,3,4),array(2,3,4),array(3,4,5),array(4,5),array(4,5,6),array(4,5,6)), array(array(1,2),array(1,2,3),array(2,3),array(2,3,4),array(2,3,4),array(3,4,5),array(4,5),array(4,5,6),array(4,5,6)) # ), $result = $data[$yoko - 1][$tate - 1]; ?> switch...


PHP
PHP

XMLjsonCSV
DB

PHP
IF



$map = [
/* * 0, 1, 2, 3, 4, 5, 6, 7, 8, */
0 => [ "1,2", "1,2,3", "2,3", "2,3,4", "2,3,4", "3,4,5", "4,5", "4,5,6", "4,5,6"],
1 => [ "1,2", "1,2,3", "2,3", "2,3,4", "2,3,4", "3,4,5", "4,5", "4,5,6", "4,5,6"],
2 => [ "1,2", "1,2,3", "2,3", "2,3,4", "2,3,4", "3,4,5", "4,5", "4,5,6", "4,5,6"],
3 => [ "2,3", "2,3", "2,3", "2,3,4", "2,3,4", "3,4,5", "4,5", "4,5,6", "4,5,6"],
4 => [ "3,4", "3,4", "3,4", "3,4", "3,4", "3,4", "4,5", "4,5,6", "4,5,6"],
5 => [ "1,2", "1,2,3", "2,3", "2,3,4", "2,3,4", "3,4,5", "4,5", "4,5,6", "4,5,6"],
/**/
]


JSONDBPHP

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 02ca44add4e9289a7d06e365d1b18b2b