我需要在Maildir之后更改单词,在此示例 中为NULL一行:(单词 NULL 可以是任何单词。)
[3]=>
string(42) "SPAM
* ^Subject: \[SPAM\].*
Maildir/.NULL/"
我使用这段代码:
if($filecontent = file_get_contents($filename)){
$repertoire = "SPAM";
$tab = explode("#", trim($filecontent));
$tab[3] = preg_replace("#Maildir/*#", 'Maildir/.'.$repertoire.'/', $tab[3]);
var_dump($tab);
但是我有
string(48) "SPAM
* ^Subject: \[SPAM\].*
Maildir/.NULL/.SPAM/"
我如何在Maildir/.SPAM中更改它,因为.NULL过多。
string(48) "SPAM
* ^Subject: \[SPAM\].*
Maildir/.SPAM/"