Page 1 of 1

Spaces between content?

Posted: Sun Jan 18, 2004 10:48 pm
by Mr. Tech
Im using a textarea to edit my html content and then fwriteing it back into the file. What seems to happen is content that looks like this:

<html>
<head>
<title>Title</title>
</head>
<body>
etc...


Ends up looking like this:

<html>

<head>

<title>Title</title>

</head>

<body>

etc...


Is there anyway to stop that?

Thanks

Posted: Sun Jan 18, 2004 11:12 pm
by markl999
It depends how you're fwriting it out. It just looks like you are adding an extra \n when writing it but without seeing the code .... *shrug* ;)

Posted: Sun Jan 18, 2004 11:35 pm
by Mr. Tech
LOL might help. Heres the code:

<?php
$fp=fopen($root.$filename,w);
fputs($fp,$text);
fclose($fp);
?>

The funny thing is it doesn't always happen....

Posted: Sun Jan 18, 2004 11:38 pm
by markl999
Hmm, looks ok (presuming the w was a typo and is actually 'w').
The extra newline must be coming from 'somewhere else' .. what OS is this on, windows, *nix, mac etc.. ? And when you say "it doesn't always happen" can you pin down exactly under what circumstances it does and does not happen?