1
這在PHP中可能嗎?在同一陣列中訪問數組元素
$a = array('first' => 'some value', 'second' => $a['first']);
只需訪問同一陣列中另一個元素中的數組元素。
這在PHP中可能嗎?在同一陣列中訪問數組元素
$a = array('first' => 'some value', 'second' => $a['first']);
只需訪問同一陣列中另一個元素中的數組元素。
不符合此語法,因爲在評估$a['first']
時,$a
未定義。這將工作雖然:
$a = array();
$a['first'] = 'some value';
$a['second'] = $a['first'];