Okay, this is basically what I’m doing:
(form sends post data with variable: text)
<?php
$text = $_POST[‘text’];
$text = nl2br($title);
$fp = fopen (‘textfile.txt’, ab);
flock ($fp, LOCK_EX);
fwrite ($fp, “$textn”);
flock ($fp, LOCK_UN);
fclose ($fp);
What happens is that the html breaks (br) start new lines and when I read it by making it an array, it registers the stuff after a break as a new line. How can I still use nl2br, but have it so it prints to the text document like:
line1|Printed text<br />more printed text<br /><br /><br />more text
line2|
line3|
line4|
line5|
instead of:
line1|Printed text<br />
line2|more printed text<br />
line3|<br />
line4|<br />
line5|more text
Any help would be really apreciated as I’ve resorted to using <input type=”text> instead of <textarea>
Edit: I’ve run int another problem too. If the text array value is something like:
“aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa”
it messes up my formating when I print it to a page. How can I cut it when it doesn’t fit in the specified area?