我知道這裏有很多文檔,但是這一行代碼花了我很長時間才找到4000行文件,我想在第一次嘗試中找到它。如何將新的鍵值對推送到數組php?
file_put_contents($myFile,serialize(array($email_number,$email_address))) or die("can't open file");
if ($address != "[email protected]") {
$email['headers'] = array('CC' => '[email protected]');
}
}
這個if語句我基本上要在
'BCC' => '[email protected]'
添加到$email['headers']
陣列後(所以它增加了它是否如果計算結果爲真實與否)
看到這個..創建數組對象並在數組中賦值.. http://hiox.org/33288-create-array-copy-using-php.php – Vaishu
if語句中的行可能不是'最好'的方式(我真的不知道),但它會工作。 $ email ['headers'] = array('BCC'=>'[email protected]'); – Jake