Re: creating a development log

From: Date: Sat, 30 Aug 2003 07:16:29 +0000
Subject: Re: creating a development log
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-161235@lists.php.net to get a copy of this message
Thanx Chris, this works. Here is the code (might help somebody else) unset($previousDate); for ($i=0; $i < $num_results; $i++){ if($previousDate != $log['date'][$i]) echo '<b>'.$log[date][$i].'</b>'.$p.'<ul>'; echo '<li>'.$log[entry][$i].'</li>'; $previousDate = $log['date'][$i]; if($previousDate != $log['date'][$i+1]){ echo '</ul>'; } } Chris W. Parker wrote:
Merlin <mailto:news.groups@web.de>
    on Friday, August 29, 2003 3:03 PM said:
Unfortuantelley this looks way more complicated than I thought. How to group by date and still get the entry, and how can I arange it, that it outputs only the one for the date and then closes the list`?
To display the output like you've got in your post you'd do something like this: (pseudo code) $arrayOfEntries = GetEntries(); $previousDate = ""; foreach($arrayOfEntries as $entry) { if($previousDate != $entry['date']) { // show date header // show comment for this record } else { // show comment only } $previousDate = $entry['date']; } Let me know if this helps (and if it doesn't too). Chris.


« previous php.general (#161235) next »