我有一个 php 脚本,它$_POST
可以决定返回哪个数组。前任:
$n = $_POST['n']; // 1, 2 or 3
$a1 = array ('something', 'something else', 'another thing');
$a2 = array ('something 2', 'something else 2', 'another thing 2');
$a3 = array ('something 3', 'something else 3', 'another thing 3');
现在我想获取与该$n
值对应的数组,比如说"2"
.
我怎么能说echo $a . $n
得到$a2
谢谢。