This is the answer.
Sorry for the post.
$filename = "./conf.php";
$fd = fopen ($filename, "r");
$DELETE = "//start_entry1";
echo"$DELETE";
$m_line=3;$tmp_line=0;$line=0;
$m_filename = "./conf2.php";
$m_fd = fopen($m_filename, "w");
while (!feof ($fd)){
$buffer = fgets($fd, 4096);
$pos = strpos ($buffer, $DELETE);
if ($pos === false and $line==0){
fputs ($m_fd,$buffer);
}
else{
if ($tmp_line < $m_line){
$tmp_line = $tmp_line + 1;
$line = 1;
}
else{
$line = 0;
}
}
}
fclose($fd);
fclose($m_fd);
copy("./conf2.php","./conf.php");
No need of //end_entry1