Hi.... I've just made this script to update a binary file for my BIND 9 DNS server.
======================= $WorkFile = "domains/db.nom.za"; $buffer = file($WorkFile); $DBfile = implode($buffer, ""); $DBfile = ereg_replace("$domain.nom.za. IN NS $fqdnold[0].", "$domain.nom.za. IN NS $fqdnnew[0].", $DBfile); $DBfile = ereg_replace("$domain.nom.za. IN NS $fqdnold[1].", "$domain.nom.za. IN NS $fqdnnew[1].", $DBfile); $DBfile = trim($DBfile)."\n"; $fp = fopen($WorkFile, 'w'); fwrite($fp, $DBfile); fclose($fp); ======================= Basicall I want to find "dub.domain.com IN NS dns.example.com" and replace it with "dub.domain.com IN NS dns1.expample.com". Note the '1' and still maintain the format of the file... My script keeps adding and extra line to every line even when I told it to trim. Any please help Kindest Regards Vins :D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php