我知道这里有很多文档,但是这一行代码花了我很长时间才找到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