我想用 PHP 将对附加到数组中,这就是我目前拥有的;
pairs[0]['key1'] = 'something1';
pairs[0]['key2'] = 'something2';
pairs[1]['key1'] = 'other1';
pairs[1]['key2'] = 'other2';
pairs[2]['key1'] = 'thing1';
pairs[2]['key2'] = 'thing2';
有没有办法不必指定索引?即伪代码;
pairs[] = [key1=something1,key2=something2]