Здравствуйте! Почему-то не работает str_replace
Код:
$conf = file_get_contents("/etc/bind/named.conf");
$link = PHP_EOL."zone \"$Domain->mainname\" {
type master;
file \"/etc/bind/$Domain->mainname \" ;
}";
$new = str_replace($link,"",$conf);
echo PHP_EOL.$new;
$conf:
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
zone "yusi.com" {
type master;
file "/etc/bind/yusi.com " ;
}
zone "yusi.net" {
type master;
file "/etc/bind/yusi.net " ;
}
zone "gara.bg" {
type master;
file "/etc/bind/gara.bg " ;
}
zone "grabo.bg" {
type master;
file "/etc/bind/grabo.bg " ;
}
zone "mimi.com" {
type master;
file "/etc/bind/mimi.com " ;
}
$link:
zone "gara.bg" {
type master;
file "/etc/bind/gara.bg " ;
}
Какой файл я ожидаю получить на выходе:
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
zone "yusi.com" {
type master;
file "/etc/bind/yusi.com " ;
}
zone "yusi.net" {
type master;
file "/etc/bind/yusi.net " ;
}
zone "gara.bg" {
type master;
file "/etc/bind/gara.bg " ;
}
zone "mimi.com" {
type master;
file "/etc/bind/mimi.com " ;
}
А получаю тоже самое содержимое, что и в $conf.
Права на файл есть.