Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$dizi = array( "tr" => "Turkey", "uk" => "United Kingdom", "us" => "United States" );
我想添加"br"=>"brasil"到数组的末尾。
"br"=>"brasil"
谢谢。
没什么:
$dizi['br'] = 'brasil';
你可以这样做:
$dizi['br'] = "brasil"
一个更接近的语法结构array_push是:
array_push
$dizi += array("br" => "Brasil");
请注意+= 但是对于单个添加,您应该更喜欢直接数组分配(如其他答案中所指出的)。