Hey there!
This is my absolutely first time posting in a newsgroup, so be nice please
; )
I've written a guestbook, and in an attempt to get the newest entries first
I reversed the guestbook-txt-file. Like so:
$tabell = file( "gjestebok.txt" );
$revtab = array_reverse( $tabell );
$antall = count( $revtab );
$i = 0;
if( !( $fil = fopen( "guestbook.txt", "r+" ) ) )
die();
while( $i < $antall )
{
fwrite( $fil, "$revtab[$i]" );
$i++;
}
fclose( $fil );
Now the problem: If I post a message with a line of text, a newline (as in
hitting the return-key), some more text and newlines, these
newline-separated text-lines show before the posting itself after reversing
because they are independent elements in the array.....
How can I fix this????
Mogens
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]