我声明一个这样的数组:
$statement_row = array(
"Key 1" => "",
"Key 2" => "",
"Key 3" => "");
然后我从一个表中读取数据,这些数据在第0列中具有相应的键,在第3列中具有值,因此我循环遍历该表中的每一行,如下所示:
foreach($table_row as $value){
if(!empty($value[0])){
$statement_row[ $value[0] ] = $value[3];
}
}
这给出了一个数组,其中包含键1,键2和键3的重复键,如下所示:
array("Key 1" => "","Key 2" => "","Key 3" => "","Key 1" => "Holds value","Key 2" => "Holds value","Key 3" => "Holds value");
为什么它会像这样? $ value [0]的威胁是否与定义的密钥相同?