Re: Problems after reversing a guestbook

From: Date: Tue, 01 May 2001 12:46:41 +0000
Subject: Re: Problems after reversing a guestbook
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-50963@lists.php.net to get a copy of this message
On Sun, Apr 29, 2001 at 01:03:15AM +0200, Mogens Nielsen wrote: > 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???? The short answer is use a database. The long answer is to write your function to reverse the array. You could have the original array passed to the function and your function return a reversed one. In your function, you would have to do some checking. If the index is a new entry into your guestbook, then create a new index in the new array. If not, just prepend the text to the last index of the array. I'm imaging that your text file is delimited by something. You may want to explode each line so you can tell if it belongs together or not. -- Jason Stechschulte jpstech@unoh.edu -- double value; /* or your money back! */ short changed; /* so triple your money back! */ -- Larry Wall in cons.c from the perl source code

« previous php.general (#50963) next »