Re: [PHP] Re: Binary Files :: They Keep Adding Blocks

2002-07-18 Thread Danny Shepherd

Try using just '\n' not '\r\n' as notepad doesn't understand carriage
returns, hence the funny little square.

- Original Message -
From: "Vincent Kruger" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 18, 2002 9:11 AM
Subject: Re: [PHP] Re: Binary Files :: They Keep Adding Blocks


> yeah but your check i get this funny little square in note pad.
> it's a line carier... but if i take it out then everything is one line
which
> i don't want.
> and if i take it out and then put it in again i'm back to sqaure one.
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Binary Files :: They Keep Adding Blocks

2002-07-18 Thread Vincent Kruger

yeah but your check i get this funny little square in note pad.
it's a line carier... but if i take it out then everything is one line which
i don't want.
and if i take it out and then put it in again i'm back to sqaure one.

- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 18, 2002 8:56 AM
Subject: Re: [PHP] Re: Binary Files :: They Keep Adding Blocks


On Thursday 18 July 2002 13:14, vins wrote:
> How do i debug.
> Thats why i asked

echo/print out key variables at strategic points in the code. Ensure that
they
contain what you expect them to contain.

--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Q: Heard about the  who couldn't spell?
A: He spent the night in a warehouse.
*/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Binary Files :: They Keep Adding Blocks

2002-07-17 Thread Jason Wong

On Thursday 18 July 2002 13:14, vins wrote:
> How do i debug.
> Thats why i asked

echo/print out key variables at strategic points in the code. Ensure that they 
contain what you expect them to contain.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Q:  Heard about the  who couldn't spell?
A:  He spent the night in a warehouse.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Binary Files :: They Keep Adding Blocks

2002-07-17 Thread vins

How do i debug.
Thats why i asked

"Vins" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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